Tinkerpop Gremlin控制台:java.lang.NoSuchMethodError:org.apache.tinkerpop.gremlin.driver.RequestOptions $ Builder.userAgent [英] Tinkerpop Gremlin Console: java.lang.NoSuchMethodError: org.apache.tinkerpop.gremlin.driver.RequestOptions$Builder.userAgent

查看:212
本文介绍了Tinkerpop Gremlin控制台:java.lang.NoSuchMethodError:org.apache.tinkerpop.gremlin.driver.RequestOptions $ Builder.userAgent的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为我在> 403中针对Gremlin到AWS Neptune的禁止错误,我可以通过安装在EC2实例上的Tinkerpop Gremlin控制台v 3.4.3(如 https://docs.aws.amazon.com/neptune/latest/userguide/iam-auth- connection-gremlin-console.html 不适用于我。

  
\ ,, ,/
(oo)
----- oOOo-(3)-oOOo -----
插件已激活:tinkerpop.server
插件已激活:tinkerpop.utilities
插件已激活:tinkerpop.tinkergraph
gremlin> :远程连接tinkerpop.server conf / neptune-remote.yaml
==>已配置的<我的海王星> .cluster-cm<集群ID> .ap-southeast-2.neptune.amazonaws.com /<私人ip>:8182
gremlin> :远程控制台
==>所有脚本现在都将发送到Gremlin Server-[< my neptune> .cluster-cm< cluster id> .ap-southeast-2.neptune.amazonaws.com /<私有ip>:8182]-输入':remote console'以返回本地模式

但是,我在控制台上使用的所有Gremlin命令(g。)都出现NoSuchMethodError错误。



例如:
gV()

  gremlin> g.V()
org.apache.tinkerpop.gremlin.driver.RequestOptions $ Builder.userAgent(Ljava / lang / String;)Lorg / apache / tinkerpop / gremlin / driver / RequestOptions $ Builder;
键入:help或:h以获取帮助。
显示堆栈跟踪? [yN] Y
java.lang.NoSuchMethodError:org.apache.tinkerpop.gremlin.driver.RequestOptions $ Builder.userAgent(Ljava / lang / String;)Lorg / apache / tinkerpop / gremlin / driver / RequestOptions $ Builder ;
在org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.send(DriverRemoteAcceptor.java:214)
在org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor。 java:168)org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:110)中的

...

g.addV('person')。property('name','justin')

  gremlin> g.addV('person')。property('name','justin')
org.apache.tinkerpop.gremlin.driver.RequestOptions $ Builder.userAgent(Ljava / lang / String;)Lorg / apache / tinkerpop / gremlin / driver / RequestOptions $ Builder;
键入:help或:h以获取帮助。
显示堆栈跟踪? [yN] Y
java.lang.NoSuchMethodError:org.apache.tinkerpop.gremlin.driver.RequestOptions $ Builder.userAgent(Ljava / lang / String;)Lorg / apache / tinkerpop / gremlin / driver / RequestOptions $ Builder ;
在org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.send(DriverRemoteAcceptor.java:214)
在org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor。 java:168)org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:110)
....


我也尝试了最新的Apache Tinkerpop Gremlin Console 3.4.6,我遇到了同样的错误...



谢谢

解决方案

我认为您缺少的步骤是采用EC2实例分配的IAM角色提供的临时凭据,并且将它们推送到默认凭据提供程序链中,以使它们可以被Gremlin Console使用的SigV4Channelizer看到。可以在此处查看该过程的高级概述: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html



可以在此处找到针对海王星的更规范的处理方式: https://docs.aws.amazon.com/neptune/latest/userguide/iam-auth-temporary-credentials.html 请参阅标题为为Neptune IAM设置Amazon EC2的部分身份验证。


As my last post at 403 Forbidden error for Gremlin to AWS Neptune, I could successfully connect to my Neptune Cluster DB via my Tinkerpop Gremlin console v 3.4.3 that installed at my EC2 instance as v 3.4.1 suggested at https://docs.aws.amazon.com/neptune/latest/userguide/iam-auth-connecting-gremlin-console.html didn't work for me.


         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> :remote connect tinkerpop.server conf/neptune-remote.yaml
==>Configured <my neptune>.cluster-cm<cluster id>.ap-southeast-2.neptune.amazonaws.com/<private ip>:8182
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [<my neptune>.cluster-cm<cluster id>.ap-southeast-2.neptune.amazonaws.com/<private ip>:8182] - type ':remote console' to return to local mode

However, I'm getting NoSuchMethodError error for all Gremlin commands (g.) that I used on the console.

e.g: g.V()

gremlin> g.V()
org.apache.tinkerpop.gremlin.driver.RequestOptions$Builder.userAgent(Ljava/lang/String;)Lorg/apache/tinkerpop/gremlin/driver/RequestOptions$Builder;
Type ':help' or ':h' for help.
Display stack trace? [yN]Y
java.lang.NoSuchMethodError: org.apache.tinkerpop.gremlin.driver.RequestOptions$Builder.userAgent(Ljava/lang/String;)Lorg/apache/tinkerpop/gremlin/driver/RequestOptions$Builder;
    at org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.send(DriverRemoteAcceptor.java:214)
    at org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:168)
    at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:110)
...

g.addV('person').property('name', 'justin')

gremlin> g.addV('person').property('name', 'justin')
org.apache.tinkerpop.gremlin.driver.RequestOptions$Builder.userAgent(Ljava/lang/String;)Lorg/apache/tinkerpop/gremlin/driver/RequestOptions$Builder;
Type ':help' or ':h' for help.
Display stack trace? [yN]Y
java.lang.NoSuchMethodError: org.apache.tinkerpop.gremlin.driver.RequestOptions$Builder.userAgent(Ljava/lang/String;)Lorg/apache/tinkerpop/gremlin/driver/RequestOptions$Builder;
    at org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.send(DriverRemoteAcceptor.java:214)
    at org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:168)
    at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:110)
....

I have also tried the latest Apache Tinkerpop Gremlin Console 3.4.6, same error I had...

Thanks

解决方案

I think the step you're missing is taking the temporary credentials provided by your EC2 instance's assigned IAM role and pushing those into the Default Credential Provider chain in order for them to be seen by the SigV4Channelizer used by the Gremlin Console. A high level overview of that process can be seen here: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html

A more prescriptive way of handling this for Neptune can be found here: https://docs.aws.amazon.com/neptune/latest/userguide/iam-auth-temporary-credentials.html See the section titled, "Setting Up Amazon EC2 for Neptune IAM Authentication".

这篇关于Tinkerpop Gremlin控制台:java.lang.NoSuchMethodError:org.apache.tinkerpop.gremlin.driver.RequestOptions $ Builder.userAgent的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆