【问题标题】:Janus Graph Remote Graph NoSuchFieldError: V3_0 errorJanus Graph 远程图 NoSuchFieldError: V3_0 错误
【发布时间】:2018-11-22 10:13:48
【问题描述】:

我遵循这个例子;

https://github.com/JanusGraph/janusgraph/tree/master/janusgraph-examples/example-remotegraph

我想调试这个项目,我配置了(HBase+Solr)并运行 Janus Graph 服务器

$JANUSGRAPH_HOME/bin/gremlin-server.sh $JANUSGRAPH_HOME/conf/gremlin-server/gremlin-server.yaml

命令。 我通过 Run Configuration > Program Arguments 将此参数传递给 IDEA

[项目主页]/conf/jgex-remote.properties

我的 jgex-remote.properties 文件是:

gremlin.remote.remoteConnectionClass=org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection
# cluster file has the remote server configuration
gremlin.remote.driver.clusterFile=[Project Home]/conf/remote-objects.yaml
# source name is the global graph traversal source defined on the server
gremlin.remote.driver.sourceName=g 

我的 remote-objects.yaml 文件包括:

hosts: [127.0.0.1]
port: 8182
serializer: {
    className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0,
    config: {
        ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry]
    }
}

它尝试运行这个命令:

cluster = Cluster.open(conf.getString("gremlin.remote.driver.clusterFile"));

并抛出此异常:

线程“main”中的异常 java.lang.NoSuchFieldError: V3_0 at org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0.(GryoMessageSerializerV3d0.java:41) 在 org.apache.tinkerpop.gremlin.driver.ser.Serializers.simpleInstance(Serializers.java:77) 在 org.apache.tinkerpop.gremlin.driver.Cluster$Builder.(Cluster.java:472) 在 org.apache.tinkerpop.gremlin.driver.Cluster$Builder.(Cluster.java:469) 在 org.apache.tinkerpop.gremlin.driver.Cluster.getBuilderFromSettings(Cluster.java:167) 在 org.apache.tinkerpop.gremlin.driver.Cluster.build(Cluster.java:159) 在 org.apache.tinkerpop.gremlin.driver.Cluster.open(Cluster.java:233) 在 com.ets.dataplatform.init.RemoteGraphApp.openGraph(RemoteGraphApp.java:72) 在 com.ets.dataplatform.init.GraphApp.runApp(GraphApp.java:290) 在 com.ets.dataplatform.init.RemoteGraphApp.main(RemoteGraphApp.java:195)

对我来说没有意义。

提前致谢。

【问题讨论】:

  • 您确定使用配置remote-objects.yaml 来创建Cluster?异常表示它尝试使用GryoMessageSerializerV3d0,但您的配置包含GryoMessageSerializerV1d0。我不认为 JanusGraph 支持 Gryo V3,所以你真的应该确保你使用的是较低版本。
  • 嗨,@florian-hockmann 感谢您的评论。是的, conf.getString("gremlin.remote.driver.clusterFile") 表达式获取正确的 remote-objects.yaml 文件。就像你说的那样,它包括GryoMessageSerializerV1d0,但是从GryoMessageSerializerV3d0 得到的错误对我来说是不明智的。

标签: serialization tinkerpop janusgraph gremlin-server


【解决方案1】:

我会尝试调整您的版本。我假设您使用的是 JanusGraph 0.2.0。如果您查看该版本的 pom.xml,您会发现它绑定到 TinkerPop 3.2.6:

https://github.com/JanusGraph/janusgraph/blob/v0.2.0/pom.xml#L68

在您的应用程序中更改为该版本并查看连接是否有效。采用这种方法不仅可以解决您的问题,还可以确保您不会遇到其他不兼容问题。这并不是说您无法将更高版本的 TinkerPop 配置为与 3.2.6 一起使用,但它需要更多配置,并且您必须注意可能会影响某些操作行为方式的细微更改。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-06-12
    • 2017-10-26
    • 1970-01-01
    • 1970-01-01
    • 2017-02-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多