I am using TinkerGraph through GremlinServer V3.4.1 and I am trying to get familiar with using gremlin when connecting from a java app.
I have created a client session, such that I can make multiple graph inserts in a single transaction, much as I would with any other db.
The setup is summarized below:
Cluster cluster = Cluster.open(getGraphServerConfiguration());
String sessionId = UUID.randomUUID().toString();
Client sessionClient = cluster.connect(sessionId);
GraphTraversalSource g = AnonymousTraversalSource.traversal().withRemote(DriverRemoteConnection.using(sessionClient));
However, if I query the server using the traversal source, e.g.
g.V().next();
It always results in the response error "REQUEST_ERROR_MALFORMED_REQUEST" and "ResponseException: Message with op code [bytecode] is not recognized."
Stack trace:
Caused by: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Message with op code [bytecode] is not recognized.
at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:259)
at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:198)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
...
I wondered what I am doing wrong? The error suggests that bytecode operations are not permitted when calling (though a SessionClient) into a session but, if that is the case, what is the purpose of being able to create a traversal source based on a such a client?
Thanks,
Dave