【问题标题】:Gremlin server with neo4j带有 neo4j 的 Gremlin 服务器
【发布时间】:2017-11-22 12:49:08
【问题描述】:

我正在尝试使用 tinkerpop 的 gremlin-server。我无法使用 neo4j 启动 gremlin 服务器。

文档说。

请注意,TinkerPop 在其发行版中不包含 Neo4j 依赖项。要使用此文件,请确保将 Neo4j 依赖项安装到 Gremlin Server 的路径 gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin 3.y.z

我已经使用 :install 安装了 neo4j-gremlin,因为据说 -i 已被弃用。

仍然,我收到以下错误,在以下命令中

.\bin\gremlin-server.bat .\conf\gremlin-server-neo4j.yaml

错误

    [WARN] DefaultGraphManager - Graph [graph] configured at [conf/neo4j-empty.properties] could not be instantiated and will not be available in Gremlin Server.  GraphFactory message: GraphFactory could not find [org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph] - Ensure that the jar is in the classpath
java.lang.RuntimeException: GraphFactory could not find [org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph] - Ensure that the jar is in the classpath
    at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:63)
    at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:104)
    at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.lambda$new$0(DefaultGraphManager.java:57)
    at java.util.LinkedHashMap$LinkedEntrySet.forEach(Unknown Source)
    at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.<init>(DefaultGraphManager.java:55)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:105)
    at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:84)
    at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:111)
    at org.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.java:355)
[INFO] ServerGremlinExecutor - Initialized Gremlin thread pool.  Threads in pool named with pattern gremlin-*
Exception in thread "main" java.lang.IllegalStateException: java.lang.ClassNotFoundException: org.apache.tinkerpop.gremlin.neo4j.jsr223.Neo4jGremlinPlugin
    at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.initializeGremlinScriptEngineManager(GremlinExecutor.java:444)
    at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.<init>(GremlinExecutor.java:103)
    at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.<init>(GremlinExecutor.java:72)
    at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor$Builder.create(GremlinExecutor.java:586)
    at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:157)
    at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:84)
    at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:111)
    at org.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.java:355)
Caused by: java.lang.ClassNotFoundException: org.apache.tinkerpop.gremlin.neo4j.jsr223.Neo4jGremlinPlugin
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.initializeGremlinScriptEngineManager(GremlinExecutor.java:407)
    ... 7 more

【问题讨论】:

  • 您的GREMLIN_SERVER_INSTALL/ext 目录中有什么?你看到neo4j目录和相关文件了吗?另外,您提到使用gremlin-server.sh,但随后还指定使用.bat 启动-这是Windows 环境还是其他环境?
  • 我使用的是Windows环境。我在 /ext 文件夹中找不到 neo4j 目录。但是这些文件安装在 Gremlin 控制台中。从控制台目录到服务器目录的简单复制就是修复。感谢您的指导。
  • 您是说gremlin.bat :install 将neo4j jar 放在GREMLIN_SERVER_INSTALL/ext 以外的目录中吗?
  • gremlin-server.bat :install 根本不起作用。那就是问题所在。这就是为什么我无法将 neo4j 依赖项安装到 gremlin 服务器中。所以,我试图从控制台端安装 neo4j 并且成功了。然后我将 neo4j 文件夹从 gremlin 控制台复制到服务器

标签: neo4j gremlin gremlin-server


【解决方案1】:

:install 是控制台命令。

install 是服务器命令。 -i 也仍然有效。

【讨论】:

    【解决方案2】:

    作为 gremlin-python-tutorial github 项目的提交者,我的答案是查看相关行

    https://github.com/WolfgangFahl/gremlin-python-tutorial/blob/master/run

    脚本。

      version=3.4.3
      plugin=neo4j-gremlin
      gsd=apache-tinkerpop-gremlin-server-${version}
      if [ ! -d $gsd/ext/$plugin ]
      then
        color_msg $blue "installing plugin $plugin"
        $gsd/bin/gremlin-server.sh install org.apache.tinkerpop $plugin $version
      else
        color_msg $green "$plugin plugin already installed"
      fi
      color_msg $blue "starting neo4j gremlin-server ..."
      conf=$(realpath $gsd/conf/gremlin-server-neo4j.yaml)
      $gsd/bin/gremlin-server.sh $conf
    

    http://wiki.bitplan.com/index.php/Gremlin_python#Connecting_to_Gremlin_enabled_graph_databases 的 Neo4J 部分你会找到解释

    请不要检查 ext 目录是否包含安装(请参阅上面评论中斯蒂芬马莱特的问题)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多