java - Gremlin Groovy ClassCastException with Frames -
i'm receiving following error while using @gremlingroovy annotation associated tinkerpop's frames.
java.lang.classcastexception: com.thinkaurelius.titan.graphdb.relations.cacheedge cannot cast com.tinkerpop.blueprints.vertex @ com.tinkerpop.frames.structures.framedvertexiterable$1.next(framedvertexiterable.java:36) @ com.tinkerpop.frames.annotations.gremlin.gremlingroovyannotationhandler.processvertex(gremlingroovyannotationhandler.java:75) @ com.tinkerpop.frames.annotations.gremlin.gremlingroovyannotationhandler.processelement(gremlingroovyannotationhandler.java:114) @ com.tinkerpop.frames.annotations.gremlin.gremlingroovyannotationhandler.processelement(gremlingroovyannotationhandler.java:30) @ com.tinkerpop.frames.framedelement.invoke(framedelement.java:83) @ com.sun.proxy.$proxy81.getproxycandidateedgefrompersonuuid(unknown source) @ com.company.prod.domain.person$impl.toimpl(person.java:100) .... the following line causes error:
fooedge fe = foo.getfooedgefromuuid(this.getuuid()); which calling method:
@gremlingroovy("it.oute('has').filter{it.inv().has('uuid', t.eq, uuid).hasnext()}") fooedge getfooedgefromuuid(@gremlinparam("uuid") string uuid); i've tried following traversal (which causes same error):
@gremlingroovy("it.out('has').has('uuid', t.eq, uuid).ine('has')") however, when open gremlin shell test out same exact traversal - works out fine. thoughts on may causing issue?
this isn't of answer workaround. instead of using @gremlingroovy annotation 1 can use gremlin @javahandler annotation.
@javahandler void getfooedgefromuuid(string uuid); abstract class impl implements javahandlercontext<vertex>, foo { public fooedge getfooedgefromuuid(string uuid) { return frameedges( gremlin().out("has") .has("person-uuid", tokens.t.eq, uuid) .ine("has"), fooedge.class).iterator().next(); } }
Comments
Post a Comment