groovy 在将Apache Gremlin 3.6.2升级到任何更新版本后,没有方法异常的签名

lb3vh1jj  于 2023-06-21  发布在  Apache
关注(0)|答案(1)|浏览(120)

这是一个现有的项目,可以与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)])], ...]\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]

如何修复No signature of method异常?

gojuced7

gojuced71#

我认为你遇到了这个问题的一个变体:TINKERPOP-2953
基本上,Groovy的升级似乎改变了某些导入的加载方式,因此您的and()步骤被视为Operator.and。此问题应仅影响脚本提交。基于字节码的请求不应该有这个问题,因为它们不依赖于Groovy。
该问题中提到的解决方法是通过使用__的匿名遍历类显式地使用该步骤,如__.and(...)中所示。

相关问题