我是按照指示做的
here
用于为neo4j配置gremlin服务器。
但是,当我执行命令时
bin/gremlin-server.sh install org.apache.tinkerpop neo4j-gremlin 3.3.3
,存在解决依赖关系的问题(我猜)
Installing dependency org.apache.tinkerpop neo4j-gremlin 3.3.3
[INFO] IndyInterface - Copying - /Users/cbd/Dev/Apps/apache-tinkerpop-gremlin-server-3.3.3/ext/neo4j-gremlin/plugin/neo4j-gremlin-3.3.3.jar
[INFO] DependencyGrabber$_copyTo_closure6 - Copying - /Users/cbd/Dev/Apps/apache-tinkerpop-gremlin-server-3.3.3/ext/neo4j-gremlin/plugin/neo4j-tinkerpop-api-0.1.jar
Could not install the dependency: java.lang.RuntimeException: Error grabbing Grapes -- [download failed: org.slf4j#slf4j-api;1.7.22!slf4j-api.jar]
java.lang.RuntimeException: java.lang.RuntimeException: Error grabbing Grapes -- [download failed: org.slf4j#slf4j-api;1.7.22!slf4j-api.jar]
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber.getAdditionalDependencies(DependencyGrabber.groovy:198)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber.copyDependenciesToPath(DependencyGrabber.groovy:123)
at org.apache.tinkerpop.gremlin.server.util.GremlinServerInstall.main(GremlinServerInstall.java:38)
Caused by: java.lang.RuntimeException: Error grabbing Grapes -- [download failed: org.slf4j#slf4j-api;1.7.22!slf4j-api.jar]
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at groovy.grape.GrapeIvy.getDependencies(GrapeIvy.groovy:422)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at groovy.grape.GrapeIvy.resolve(GrapeIvy.groovy:569)
at groovy.grape.GrapeIvy.resolve(GrapeIvy.groovy:532)
at groovy.grape.Grape.resolve(Grape.java:202)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber$_getAdditionalDependencies_closure8.doCall(DependencyGrabber.groovy:190)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
at groovy.lang.Closure.call(Closure.java:418)
at groovy.lang.Closure.call(Closure.java:434)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2125)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1980)
at org.codehaus.groovy.runtime.dgm$160.doMethodInvoke(Unknown Source)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber.getAdditionalDependencies(DependencyGrabber.groovy:185)
... 3 more
我尝试了另一种解决方案,从Maven Central Repository手动下载Neo4J Gremlin的jar,并将其放到
提取
与其他插件具有相同结构的文件夹。但是,在尝试启动服务器时,我得到了以下错误堆栈:
bin/gremlin-server.sh conf/gremlin-server-neo4j.yaml
[INFO] GremlinServer -
\,,,/
(o o)
-----oOOo-(3)-oOOo-----
[INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-neo4j.yaml
[INFO] MetricManager - Configured Metrics ConsoleReporter configured with report interval=180000ms
[INFO] MetricManager - Configured Metrics CsvReporter configured with report interval=180000ms to fileName=/tmp/gremlin-server-metrics.csv
[INFO] MetricManager - Configured Metrics JmxReporter configured with domain= and agentId=
[INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
[ERROR] ServerGremlinExecutor - Could not invoke constructor on class org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager (defined by the 'graphManager' setting) with one argument of class Settings
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.(ServerGremlinExecutor.java:91)
at org.apache.tinkerpop.gremlin.server.GremlinServer.(GremlinServer.java:120)
at org.apache.tinkerpop.gremlin.server.GremlinServer.(GremlinServer.java:84)
at org.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.java:343)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.(ServerGremlinExecutor.java:80)
... 3 more
Caused by: java.lang.NoClassDefFoundError: org/neo4j/tinkerpop/api/Neo4jGraphAPI
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:78)
at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:70)
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(LinkedHashMap.java:671)
at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.(DefaultGraphManager.java:55)
... 8 more
Caused by: java.lang.ClassNotFoundException: org.neo4j.tinkerpop.api.Neo4jGraphAPI
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 19 more
[INFO] OpLoader - Adding the standard OpProcessor.
[INFO] OpLoader - Adding the session OpProcessor.
[INFO] OpLoader - Adding the traversal OpProcessor.
[INFO] GremlinServer - Shutting down OpProcessor[]
[INFO] GremlinServer - Shutting down OpProcessor[session]
[INFO] GremlinServer - Shutting down OpProcessor[traversal]
[INFO] GremlinServer - Shutting down thread pools.
Exception in thread "gremlin-server-shutdown" java.lang.NullPointerException
at org.apache.tinkerpop.gremlin.server.GremlinServer.stop(GremlinServer.java:253)
at org.apache.tinkerpop.gremlin.server.GremlinServer.lambda$new$0(GremlinServer.java:101)
at java.lang.Thread.run(Thread.java:748)
如何成功配置gremlin服务器和neo4j?