与neo4j的Gremlin服务器

时间:2017-06-20 06:17:33

标签: neo4j gremlin gremlin-server

我试图通过tinkerpop使用gremlin-server。我无法使用neo4j启动gremlin服务器。

文件说。

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

将Neo4j依赖项安装到Gremlin Server的路径中

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

仍然,我在以下命令

上收到以下错误
.\bin\gremlin-server.bat .\conf\gremlin-server-neo4j.yaml

ERROR

    [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

2 个答案:

答案 0 :(得分:1)

:install是控制台命令。

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

答案 1 :(得分:0)

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

的相关行。

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

脚本。

select person_id, licence_id,
       max(case when field = 'NUMBER' then expected end) as expected_number,
       max(case when field = 'NUMBER' then actual end) as actual_number,
       max(case when field = 'NUMBER' then actual end) as actual_number,
       max(case when field = 'ISSUE_DT' then expected end) as expected_issue_dt,
       max(case when field = 'ISSUE_DT' then actual end) as actual_issue_dt,
       max(case when field = 'ISSUE_DT' then action end) as actual_issue_dt_action,
from t
group by person_id, licence_id

http://wiki.bitplan.com/index.php/Gremlin_python#Connecting_to_Gremlin_enabled_graph_databases的Neo4J部分中,您将找到解释

请不要检查ext目录是否包含安装程序(请参阅上面的注释中的Stephen Mallette问题)。