Traversal serializing issue while creating Vertex

16 views
Skip to first unread message

Homesh Rawat

unread,
May 9, 2018, 7:53:33 AM5/9/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi,
I am trying to create a vertex using the GraphTraversalSource and then using GraphStatement to execute statement. However, I am facing the following issue - 

Exception in thread "main" com.datastax.driver.core.exceptions.DriverException: Could not serialize Traversal's bytecode.
at com.datastax.dse.graph.internal.utils.GraphSONUtils.getStatementFromBytecodeRemoteSource(GraphSONUtils.java:111)
at com.datastax.dse.graph.internal.DseRemoteConnection.submitAsync(DseRemoteConnection.java:70)
at org.apache.tinkerpop.gremlin.process.remote.traversal.step.map.RemoteStep.promise(RemoteStep.java:89)
at org.apache.tinkerpop.gremlin.process.remote.traversal.step.map.RemoteStep.processNextStart(RemoteStep.java:65)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:128)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:38)
at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.next(DefaultTraversal.java:200)
at OVertex.createVertex(OVertex.java:13)
at Application.main(Application.java:34)
Caused by: org.apache.tinkerpop.shaded.jackson.databind.JsonMappingException: [no message for java.lang.NullPointerException]
at org.apache.tinkerpop.shaded.jackson.databind.ser.DefaultSerializerProvider._wrapAsIOE(DefaultSerializerProvider.java:509)
at org.apache.tinkerpop.shaded.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:482)
at org.apache.tinkerpop.shaded.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
at org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3893)
at org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:3164)
at org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter.writeObject(GraphSONWriter.java:184)
at com.datastax.dse.graph.internal.utils.GraphSONUtils.writeValueAsString(GraphSONUtils.java:79)
at com.datastax.dse.graph.internal.utils.GraphSONUtils.getStatementFromBytecodeRemoteSource(GraphSONUtils.java:108)
... 8 more
Caused by: java.lang.NullPointerException
at org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer.typeId(TypeSerializer.java:79)
at org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdScalarSerializer.serializeWithType(StdScalarSerializer.java:44)
at org.apache.tinkerpop.shaded.jackson.databind.ser.impl.TypeWrappedSerializer.serialize(TypeWrappedSerializer.java:32)
at org.apache.tinkerpop.shaded.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
... 14 more



The code for creating Vertex is following - 

public void createVertex(GraphTraversalSource g, String label, DseSession session) {
        if (Schema.isExists(session, label, Constants.VERTEX)) {

GraphStatement s1 = DseGraph.statementFromTraversal(g.addV(label));

session.executeGraph(s1);

}

}



Can you please help me with this issue?

-
Homesh

Kevin Gallardo

unread,
May 9, 2018, 9:25:37 AM5/9/18
to java-dri...@lists.datastax.com
Hi Homesh, 

Which version of the driver are you using? Are you adding an extra dependency to Tinkerpop in your project and which version? This works for me with the Tinkerpop version that comes bundled with the driver.

Thanks.

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.



--
Kévin Gallardo.
Software Engineer in Developers Tools Team,
DataStax.

Homesh Rawat

unread,
May 9, 2018, 9:41:35 AM5/9/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi Kevin,
I am using 1.6.6 version of the dse-java-driver-core and dse-java-driver-graph.
Please have a look at the following pom file that I am using.


<dependency>

<groupId>com.datastax.dse</groupId>

<artifactId>dse-java-driver-core</artifactId>

<version>1.6.6</version>

</dependency>

<dependency>

<groupId>com.datastax.dse</groupId>

<artifactId>dse-java-driver-graph</artifactId>

<version>1.6.6</version>

</dependency>

<dependency>

<groupId>org.apache.tinkerpop</groupId>

<artifactId>gremlin-driver</artifactId>

<version>3.2.6</version>

</dependency>

<dependency>

<groupId>org.apache.tinkerpop</groupId>

<artifactId>gremlin-shaded</artifactId>

<version>3.3.2</version>

</dependency>

<dependency>

<groupId>com.tinkerpop</groupId>

<artifactId>gremlin-core</artifactId>

<version>3.0.0.M7</version>

</dependency>

Kevin Gallardo

unread,
May 9, 2018, 9:57:02 AM5/9/18
to java-dri...@lists.datastax.com
Thanks for the details.

Indeed using different versions of separate TinkerPop artifacts is likely to cause problems here. 

Is there any reason why you wouldn't be able to have everything set to TinkerPop 3.3.2? The driver should be ok if you were to set 3.3.2 to all the tinkerpop artifacts there.

Hope that helps.

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.

Homesh Rawat

unread,
May 9, 2018, 10:02:34 AM5/9/18
to DataStax Java Driver for Apache Cassandra User Mailing List
Thanks Kevin for the advice. 
Changing all the versions of tinkerpop to 3.3.2 worked.

-
Homesh
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.
Reply all
Reply to author
Forward
0 new messages