Rostislav Krasny
Rostislav Krasny

Reputation: 695

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

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:

[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?

Upvotes: 1

Views: 311

Answers (1)

stephen mallette
stephen mallette

Reputation: 46226

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(...).

Upvotes: 3

Related Questions