英文:
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='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)])], ...]\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(...)
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论