Closed dmill-bz closed 9 years ago
Ok I've rebuilt TP3 and Titan09 with the current SNAPSHOTS and this seems to work correctly so I'm closing this.
I spoke too soon, I still get this error. I however don't know if it's expected behavior as the following works fine:
newVertex = g.addV(); g.V(81948880).addOutE("HAS_MIGRATION", newVertex).next()
This is a complete guess but it might be TP3 related. Looks like maybe the difference between two expressions is that the first is iterated outside the scope of the transaction and the later within? Again a complete guess on my part. But it reminds me of https://issues.apache.org/jira/browse/TINKERPOP3-109
Might be confirmed from the fact that the following works:
newVertex = g.addV(); otherVertex = g.V(81948880).addOutE("HAS_MIGRATION", newVertex); graph.tx().commit(); otherVertex
Going to reopen on the off chance this is something to look into.
And although
newVertex = g.addV(); g.V(81948880).addOutE("HAS_MIGRATION", newVertex).next()
works fine in the console (Gryo) it throws the following error using the GraphSON serializer:
WARN org.apache.tinkerpop.gremlin.server.handler.WsGremlinResponseEncoder - The result [ResponseResult{data=[e[17e-3bk-5jp-36w][4304-HAS_MIGRATION->4136]], meta={}}] in the request e8315923-d98d-4035-a34f-c8d8941114e5 could not be serialized and returned.
java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: org/apache/tinkerpop/gremlin/util/StreamFactory
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.tinkerpop.gremlin.server.handler.WsGremlinResponseEncoder.encode(WsGremlinResponseEncoder.java:67)
at org.apache.tinkerpop.gremlin.server.handler.WsGremlinResponseEncoder.encode(WsGremlinResponseEncoder.java:45)
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:89)
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:633)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:691)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:626)
at org.apache.tinkerpop.gremlin.server.handler.IteratorHandler.write(IteratorHandler.java:119)
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:633)
at io.netty.channel.AbstractChannelHandlerContext.access$1900(AbstractChannelHandlerContext.java:32)
at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.write(AbstractChannelHandlerContext.java:908)
at io.netty.channel.AbstractChannelHandlerContext$WriteAndFlushTask.write(AbstractChannelHandlerContext.java:960)
at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run(AbstractChannelHandlerContext.java:893)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/apache/tinkerpop/gremlin/util/StreamFactory
at com.thinkaurelius.titan.graphdb.relations.AbstractTypedRelation.properties(AbstractTypedRelation.java:144)
at org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONSerializers$EdgeJacksonSerializer.writeProperties(GraphSONSerializers.java:146)
at org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONSerializers$EdgeJacksonSerializer.ser(GraphSONSerializers.java:138)
at org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONSerializers$EdgeJacksonSerializer.serialize(GraphSONSerializers.java:118)
at org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONSerializers$EdgeJacksonSerializer.serialize(GraphSONSerializers.java:105)
at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:100)
at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:21)
at com.fasterxml.jackson.databind.ser.std.AsArraySerializerBase.serialize(AsArraySerializerBase.java:183)
at org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONUtil.writeWithType(GraphSONUtil.java:46)
at org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV1d0$ResponseMessageSerializer.ser(AbstractGraphSONMessageSerializerV1d0.java:235)
at org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV1d0$ResponseMessageSerializer.serialize(AbstractGraphSONMessageSerializerV1d0.java:205)
at org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV1d0$ResponseMessageSerializer.serialize(AbstractGraphSONMessageSerializerV1d0.java:197)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:114)
at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:2811)
at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsBytes(ObjectMapper.java:2292)
at org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV1d0.serializeResponseAsBinary(AbstractGraphSONMessageSerializerV1d0.java:107)
at org.apache.tinkerpop.gremlin.server.handler.WsGremlinResponseEncoder.lambda$encode$64(WsGremlinResponseEncoder.java:67)
at org.apache.tinkerpop.gremlin.server.handler.WsGremlinResponseEncoder$$Lambda$153/1714823976.call(Unknown Source)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
... 1 more
Caused by: java.lang.ClassNotFoundException: org.apache.tinkerpop.gremlin.util.StreamFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 22 more
The StreamFactory
class was removed from TinkerPop and replaced with IteratorUtils
. That was broken late last Friday. Just fixed it this morning - pushed.
As for the other issue - your issue boils down to how you are iterating the traversal. Note that this works:
gremlin> :> g.addV().next()
==>v[4216]
gremlin> :> g.V()
==>v[4216]
gremlin> :> x=g.addV().next();g.V(4216).addOutE("knows",x).next()
==>e[sv-394-t1-3a8][4216-knows->4256]
gremlin> :> g.V()
==>v[4216]
==>v[4256]
gremlin> :> g.E()
==>e[sv-394-t1-3a8][4216-knows->4256]
For now the workaround is to not let Gremlin Server iterate results automatically when those results involve mutations. Trying to figure out how to make that work differently so it's not confusing to people. Tracking here:
https://issues.apache.org/jira/browse/TINKERPOP3-704
This issue doesn't appear to be Titan related and has a workaround - closing.
You close the transaction before to create the edge, that's why you get an exception.
If you want to reuse a vertex you have to map it again, or you have to use it within the same transaction.
Cheers, Frédéric
Hey,
I'm using titan09 with gremlin-console M9-RC3. I'm getting an error when I try to create a vertex and then attach another one to it. I don't know if this is an issue or if I'm doing something wrong. Here's how to recreate it:
Let me know if you need any extra information.