【问题标题】:GraphFactory could not instantiate this Graph implementation [class org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph]]GraphFactory 无法实例化此 Graph 实现 [class org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph]]
【发布时间】:2019-08-29 14:02:45
【问题描述】:

我有高可用性集群(Neo4j),其中在主服务器上有 gremlin 服务器,在从服务器上有 gremlin 控制台。但是当我在 master 上启动 gremlin 服务器时,出现以下错误。我用不同版本的 gremlin 服务器和控制台尝试了相同的过程,但我无法从 gremlin 控制台访问图形。当我在控制台中点击 g.V() 时,我在 gremlin 控制台中收到 gremlin-groovy is not an available GremlinScriptEngine" 的错误。

ec2-user@ip-172-31-0-10 apache-tinkerpop-gremlin-server-3.4.2]$ sudo bin/greml                                                                                        in-server.sh ./conf/gremlin-server-neo4j.yaml
[INFO] GremlinServer - 3.4.2
         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----

[INFO] GremlinServer - Configuring Gremlin Server from ./conf/gremlin-server-neo                                                                                        4j.yaml
[INFO] MetricManager - Configured Metrics ConsoleReporter configured with report                                                                                         interval=180000ms
[INFO] MetricManager - Configured Metrics CsvReporter configured with report int                                                                                        erval=180000ms to fileName=/tmp/gremlin-server-metrics.csv
[INFO] MetricManager - Configured Metrics JmxReporter configured with domain= an                                                                                        d agentId=
[INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval                                                                                        =180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jRepor                                                                                        terMetrics
[WARN] DefaultGraphManager - Graph [graph] configured at [conf/neo4j-ha.properti                                                                                        es] could not be instantiated and will not be available in Gremlin Server.  Grap                                                                                        hFactory message: GraphFactory could not instantiate this Graph implementation [                                                                                        class org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph]
java.lang.RuntimeException: GraphFactory could not instantiate this Graph implem                                                                                        entation [class org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph]
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFa                                                                                        ctory.java:82)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFa                                                                                        ctory.java:70)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFa                                                                                        ctory.java:104)
        at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.lambda$n                                                                                        ew$0(DefaultGraphManager.java:57)
        at java.util.LinkedHashMap$LinkedEntrySet.forEach(LinkedHashMap.java:671                                                                                        )
        at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.<init>(D                                                                                        efaultGraphManager.java:55)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct                                                                                        orAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC                                                                                        onstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>                                                                                        (ServerGremlinExecutor.java:80)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServe                                                                                        r.java:122)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServe                                                                                        r.java:86)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.                                                                                        java:345)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.                                                                                        java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces                                                                                        sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFa                                                                                        ctory.java:78)
        ... 13 more
Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to j                                                                                        ava.lang.String
        at org.neo4j.graphdb.factory.GraphDatabaseBuilder.setConfig(GraphDatabas                                                                                        eBuilder.java:126)
        at org.neo4j.tinkerpop.api.impl.Neo4jFactoryImpl.newGraphDatabase(Neo4jF                                                                                        actoryImpl.java:45)
        at org.neo4j.tinkerpop.api.Neo4jFactory$Builder.open(Neo4jFactory.java:3                                                                                        2)
        at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.<init>(Neo4jG                                                                                        raph.java:125)
        at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.open(Neo4jGra                                                                                        ph.java:139)
        ... 18 more
[INFO] ServerGremlinExecutor - Initialized Gremlin thread pool.  Threads in pool                                                                                         named with pattern gremlin-*
[INFO] ServerGremlinExecutor - Initialized GremlinExecutor and preparing Gremlin                                                                                        ScriptEngines instances.
[ERROR] DefaultGremlinScriptEngineManager - Could not create GremlinScriptEngine                                                                                         for gremlin-groovy
java.lang.IllegalStateException: javax.script.ScriptException: javax.script.Scri                                                                                        ptException: groovy.lang.MissingPropertyException: No such property: graph for c                                                                                        lass: Script1
        at org.apache.tinkerpop.gremlin.jsr223.DefaultGremlinScriptEngineManager                                                                                        .lambda$createGremlinScriptEngine$16(DefaultGremlinScriptEngineManager.java:464)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:18                                                                                        4)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:                                                                                        193)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.j                                                                                        ava:1382)
        at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.jav                                                                                        a:580)
        at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:                                                                                        270)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.j                                                                                        ava:1382)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.ja                                                                                        va:471)
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.j                                                                                        ava:151)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEac                                                                                        hOps.java:174)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418                                                                                        )
        at org.apache.tinkerpop.gremlin.jsr223.DefaultGremlinScriptEngineManager                                                                                        .createGremlinScriptEngine(DefaultGremlinScriptEngineManager.java:450)
        at org.apache.tinkerpop.gremlin.jsr223.DefaultGremlinScriptEngineManager                                                                                        .getEngineByName(DefaultGremlinScriptEngineManager.java:219)
        at org.apache.tinkerpop.gremlin.jsr223.CachedGremlinScriptEngineManager.                                                                                        lambda$getEngineByName$0(CachedGremlinScriptEngineManager.java:57)
        at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHash                                                                                        Map.java:1660)
        at org.apache.tinkerpop.gremlin.jsr223.CachedGremlinScriptEngineManager.                                                                                        getEngineByName(CachedGremlinScriptEngineManager.java:57)
        at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eva                                                                                        l$0(GremlinExecutor.java:266)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51                                                                                        1)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.                                                                                        java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor                                                                                        .java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: javax.script.ScriptException: javax.script.ScriptException: groovy.la                                                                                        ng.MissingPropertyException: No such property: graph for class: Script1
        at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.                                                                                        eval(GremlinGroovyScriptEngine.java:378)
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
        at org.apache.tinkerpop.gremlin.jsr223.DefaultGremlinScriptEngineManager                                                                                        .lambda$createGremlinScriptEngine$16(DefaultGremlinScriptEngineManager.java:460)
        ... 24 more
Caused by: javax.script.ScriptException: groovy.lang.MissingPropertyException: N                                                                                        o such property: graph for class: Script1
        at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.                                                                                        eval(GremlinGroovyScriptEngine.java:697)
        at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.                                                                                        eval(GremlinGroovyScriptEngine.java:376)
        ... 26 more
Caused by: groovy.lang.MissingPropertyException: No such property: graph for cla                                                                                        ss: Script1
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptByteco                                                                                        deAdapter.java:65)
        at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(                                                                                        PogoGetPropertySite.java:51)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjec                                                                                        tGetProperty(AbstractCallSite.java:309)
        at Script1.run(Script1.groovy:45)
        at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.                                                                                        eval(GremlinGroovyScriptEngine.java:674)
        ... 27 more
[WARN] ServerGremlinExecutor - Could not initialize gremlin-groovy GremlinScript                                                                                        Engine as init script could not be evaluated
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: gr                                                                                        emlin-groovy is not an available GremlinScriptEngine
        at java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.j                                                                                        ava:375)
        at java.util.concurrent.CompletableFuture.join(CompletableFuture.java:19                                                                                        34)
        at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.lambda                                                                                        $new$4(ServerGremlinExecutor.java:141)
        at java.util.LinkedHashMap$LinkedKeySet.forEach(LinkedHashMap.java:559)
        at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>                                                                                        (ServerGremlinExecutor.java:136)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServe                                                                                        r.java:122)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServe                                                                                        r.java:86)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.                                                                                        java:345)
Caused by: java.lang.IllegalArgumentException: gremlin-groovy is not an availabl                                                                                        e GremlinScriptEngine
        at org.apache.tinkerpop.gremlin.jsr223.CachedGremlinScriptEngineManager.                                                                                        registerLookUpInfo(CachedGremlinScriptEngineManager.java:95)
        at org.apache.tinkerpop.gremlin.jsr223.CachedGremlinScriptEngineManager.                                                                                        getEngineByName(CachedGremlinScriptEngineManager.java:58)
        at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eva                                                                                        l$0(GremlinExecutor.java:266)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51                                                                                        1)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.                                                                                        java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor                                                                                        .java:624)
        at java.lang.Thread.run(Thread.java:748)
[INFO] OpLoader - Adding the standard OpProcessor.
[INFO] OpLoader - Adding the session OpProcessor.
[INFO] OpLoader - Adding the traversal OpProcessor.
[INFO] TraversalOpProcessor - Initialized cache for TraversalOpProcessor with si                                                                                        ze 1000 and expiration time of 600000 ms
[INFO] GremlinServer - idleConnectionTimeout was set to 0 which resolves to 0 se                                                                                        conds when configuring this value - this feature will be disabled
[INFO] GremlinServer - keepAliveInterval was set to 0 which resolves to 0 second                                                                                        s when configuring this value - this feature will be disabled
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo with o                                                                                        rg.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+gryo-string                                                                                        d with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v3.0+json with o                                                                                        rg.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0
[INFO] AbstractChannelizer - Configured application/json with org.apache.tinkerp                                                                                        op.gremlin.driver.ser.GraphSONMessageSerializerV3d0
[INFO] AbstractChannelizer - Configured application/vnd.graphbinary-v1.0 with or                                                                                        g.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1
[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1,                                                                                         gremlin pool of 1 and boss thread pool of 1.
[INFO] GremlinServer$1 - Channel started at port 8182.

【问题讨论】:

    标签: neo4j gremlin high-availability tinkerpop gremlin-server


    【解决方案1】:

    我不确定这是否是您的问题,但您需要安装 Gremlin Server Neo4j 插件,以便使用此命令显示适当的类:

    bin/gremlin-server.sh install org.apache.tinkerpop neo4j-gremlin 3.4.3
    

    在启动服务器之前。如果这不是您的问题,那么您可能需要使用更多详细信息更新您的问题,特别是(1)清理服务器输出的发布,因为当前输出中存在一些间距,难以阅读和(2 ) 你的 Gremlin 服务器初始化脚本以及你的“neo4j-ha.properties”文件。

    【讨论】:

    • 我在服务器启动前已经使用了 bin/gremlin-server.sh install org.apache.tinkerpop neo4j-gremlin 3.4.3 这个命令。这就是我启动 gremlin 服务器的方式:sudo bin/gremlin-server.sh ./conf/gremlin-server-neo4j.yaml 和 Gremlin 控制台:sudo ./bin/gremlin.sh。请在此处找到服务器日志和 neo4j-ha.properties:drive.google.com/open?id=1uePk2yor4Ksa_qBmMTcSDs-YOavCbTBL>
    • 请编辑您的问题并将这些文件的文本粘贴到那里,以便其他阅读此内容的人可以快速查看他们的问题是否与您的问题相符。
    猜你喜欢
    • 2016-12-30
    • 2017-02-26
    • 1970-01-01
    • 1970-01-01
    • 2014-03-12
    • 1970-01-01
    • 2015-03-25
    • 2022-01-03
    • 1970-01-01
    相关资源
    最近更新 更多