升级 Apache Gremlin 3.6.2 到任何更新版本后出现了没有方法签名的异常。

huangapple go评论72阅读模式
英文:

No signature of method exception after upgrading Apache Gremlin 3.6.2 to any newer version

问题

这是一个现有的项目,与Apache Gremlin 3.6.2正常工作,但在升级到任何更新的Gremlin版本 - 3.6.3或3.6.4后,无法通过单元测试:

[2023-06-13T11:34:57,445][Warning] [{}] [o.a.t.g.s.o.AbstractEvalOpProcessor]: Exception processing a script on request [RequestMessage{, requestId=31af5d9f-f623-4091-b915-9ff86be97a09, op='eval', processor='', args={gremlin=g.V('89885718930341148618906941499288497180').outE('related-account').or(and(has('effectiveDate', lte(datetime('2023-09-13T11:34:56.951Z'))), has('expirationDate', gte(datetime('2023-09-13T11:34:56.951Z')))),  and(has('effectiveDate', lte(datetime('2023-09-13T11:34:56.951Z'))), hasNot('expirationDate'))).project('effectiveDate', 'expirationDate', 'accountId', 'relationTypeCd', 'status').by('effectiveDate').by(coalesce(values('expirationDate'),constant(null))).by(inV().coalesce(values('accountId'),constant(null))).by('relationTypeCd').by(coalesce(values('status'),constant(null))).limit(10), batchSize=64}}].
groovy.lang.MissingMethodException: No signature of method: org.apache.tinkerpop.gremlin.process.traversal.Operator$8.call() is applicable for argument types: (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal...) values: [[HasStep([effectiveDate.lte(Wed Sep 13 14:34:56 IDT 2023)])], ...]
Possible solutions: wait(), name(), any(), values(), find(), dump()
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:70) ~[groovy-2.5.22-indy.jar:2.5.22]
        at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46) ~[groovy-2.5.22-indy.jar:2.5.22]
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) ~[groovy-2.5.22-indy.jar:2.5.22]
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115) ~[groovy-2.5.22-indy.jar:2.5.22]
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135) ~[groovy-2.5.22-indy.jar:2.5.22]
        at Script5.run(Script5.groovy:1) ~[?:?]
        at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:679) ~[gremlin-groovy-3.6.4.jar:3.6.4]
        at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:381) ~[gremlin-groovy-3.6.4.jar:3.6.4]
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233) ~[java.scripting:?]
        at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:272) ~[gremlin-groovy-3.6.4.jar:3.6.4]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
        at java.lang.Thread.run(Thread.java:834) ~[?:?]
[2023-06-13T11:34:57,467][Error] [{LogCorrelationId=6d9a746e-c465-447e-a6ec-5a9dbf05c253, TenantId=5e9e47c6-9158-4386-b631-29b48da0a7c8}] [c.a.x.p.g.c.NeptuneDbProvider]: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: No signature of method: org.apache.tinkerpop.gremlin.process.traversal.Operator$8.call() is applicable for argument types: (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal...) values: [[HasStep([effectiveDate.lte(Wed Sep 13 14:34:56 IDT 2023)])], ...]
Possible solutions: wait(), name(), any(), values(), find(), dump()
java.util.concurrent.ExecutionException: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: No signature of method: org.apache.tinkerpop.gremlin.process.traversal.Operator$8.call() is applicable for argument types: (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal...) values: [[HasStep([effectiveDate.lte(Wed Sep 13 14:34:56 IDT 2023)])], ...]
Possible solutions: wait(), name(), any(), values(), find(), dump()
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395) ~[?:?]
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999) ~[?:?]
...
Caused by: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: No signature of method: org.apache.tinkerpop.gremlin.process.traversal.Operator$8.call() is applicable for argument types: (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal...) values: [[HasStep([effectiveDate.lte(Wed Sep 13 14:34:56 IDT 2023)])], ...]
Possible solutions: wait(), name(), any(), values(), find(), dump()
        at org.apache.tinkerpop.g

<details>
<summary>英文:</summary>

This is an existing project that works properly with Apache Gremlin 3.6.2 but fails to pass unit tests after upgrading to any newer version of Gremlin - 3.6.3 or 3.6.4:
```java
[2023-06-13T11:34:57,445][Warning] [{}] [o.a.t.g.s.o.AbstractEvalOpProcessor]: Exception processing a script on request [RequestMessage{, requestId=31af5d9f-f623-4091-b915-9ff86be97a09, op=&#39;eval&#39;, processor=&#39;&#39;, args={gremlin=g.V(&#39;89885718930341148618906941499288497180&#39;).outE(&#39;related-account&#39;).or(and(has(&#39;effectiveDate&#39;, lte(datetime(&#39;2023-09-13T11:34:56.951Z&#39;))), has(&#39;expirationDate&#39;, gte(datetime(&#39;2023-09-13T11:34:56.951Z&#39;)))),  and(has(&#39;effectiveDate&#39;, lte(datetime(&#39;2023-09-13T11:34:56.951Z&#39;))), hasNot(&#39;expirationDate&#39;))).project(&#39;effectiveDate&#39;, &#39;expirationDate&#39;, &#39;accountId&#39;, &#39;relationTypeCd&#39;, &#39;status&#39;).by(&#39;effectiveDate&#39;).by(coalesce(values(&#39;expirationDate&#39;),constant(null))).by(inV().coalesce(values(&#39;accountId&#39;),constant(null))).by(&#39;relationTypeCd&#39;).by(coalesce(values(&#39;status&#39;),constant(null))).limit(10), batchSize=64}}].
groovy.lang.MissingMethodException: No signature of method: org.apache.tinkerpop.gremlin.process.traversal.Operator$8.call() is applicable for argument types: (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal...) values: [[HasStep([effectiveDate.lte(Wed Sep 13 14:34:56 IDT 2023)])], ...]
Possible solutions: wait(), name(), any(), values(), find(), dump()
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:70) ~[groovy-2.5.22-indy.jar:2.5.22]
        at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46) ~[groovy-2.5.22-indy.jar:2.5.22]
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) ~[groovy-2.5.22-indy.jar:2.5.22]
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115) ~[groovy-2.5.22-indy.jar:2.5.22]
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135) ~[groovy-2.5.22-indy.jar:2.5.22]
        at Script5.run(Script5.groovy:1) ~[?:?]
        at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:679) ~[gremlin-groovy-3.6.4.jar:3.6.4]
        at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:381) ~[gremlin-groovy-3.6.4.jar:3.6.4]
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233) ~[java.scripting:?]
        at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:272) ~[gremlin-groovy-3.6.4.jar:3.6.4]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
        at java.lang.Thread.run(Thread.java:834) ~[?:?]
[2023-06-13T11:34:57,467][Error] [{LogCorrelationId=6d9a746e-c465-447e-a6ec-5a9dbf05c253, TenantId=5e9e47c6-9158-4386-b631-29b48da0a7c8}] [c.a.x.p.g.c.NeptuneDbProvider]: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: No signature of method: org.apache.tinkerpop.gremlin.process.traversal.Operator$8.call() is applicable for argument types: (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal...) values: [[HasStep([effectiveDate.lte(Wed Sep 13 14:34:56 IDT 2023)])], ...]\nPossible solutions: wait(), name(), any(), values(), find(), dump()
java.util.concurrent.ExecutionException: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: No signature of method: org.apache.tinkerpop.gremlin.process.traversal.Operator$8.call() is applicable for argument types: (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal...) values: [[HasStep([effectiveDate.lte(Wed Sep 13 14:34:56 IDT 2023)])], ...]
Possible solutions: wait(), name(), any(), values(), find(), dump()
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395) ~[?:?]
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999) ~[?:?]
...
Caused by: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: No signature of method: org.apache.tinkerpop.gremlin.process.traversal.Operator$8.call() is applicable for argument types: (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal...) values: [[HasStep([effectiveDate.lte(Wed Sep 13 14:34:56 IDT 2023)])], ...]
Possible solutions: wait(), name(), any(), values(), find(), dump()
        at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:245) ~[gremlin-driver-3.6.4.jar:3.6.4]
        at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:200) ~[gremlin-driver-3.6.4.jar:3.6.4]
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-transport-4.1.90.Final.jar:4.1.90.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.90.Final.jar:4.1.90.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.90.Final.jar:4.1.90.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.90.Final.jar:4.1.90.Final]
        at org.apache.tinkerpop.gremlin.driver.Handler$GremlinSaslAuthenticationHandler.channelRead0(Handler.java:126) ~[gremlin-driver-3.6.4.jar:3.6.4]
        at org.apache.tinkerpop.gremlin.driver.Handler$GremlinSaslAuthenticationHandler.channelRead0(Handler.java:68) ~[gremlin-driver-3.6.4.jar:3.6.4]
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-transport-4.1.90.Final.jar:4.1.90.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.90.Final.jar:4.1.90.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.90.Final.jar:4.1.90.Final]

How to fix that No signature of method exception?

答案1

得分: 3

我认为你遇到了这个问题的一个变种:TINKERPOP-2953

基本上,对Groovy的升级似乎改变了某些导入的加载方式,所以你的 and() 步骤被视为 Operator.and。这个问题应该只影响脚本提交。基于字节码的请求不应该有这个问题,因为它们不依赖于Groovy。

在问题中提到的解决方法是通过使用匿名遍历类 __ 来明确使用该步骤,如 __.and(...)

英文:

I think you are running into a variation of this problem: TINKERPOP-2953

Basically, the upgrade that was done to Groovy seemed to change the way that certain imports were loaded and so your and() step is being treated like Operator.and. This issue should only affect script submission. Bytecode-based requests should not have this problem as they don't rely on Groovy.

The workaround as noted in the issue is to explicitly use the step by using the anonymous traversal class of __, as in __.and(...).

huangapple
  • 本文由 发表于 2023年6月13日 16:48:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76463183.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定