Serializing a JanusGraph subgraph in Gremlin-Java
Object o = g.V().has("id", 1).repeat(__.bothE().subgraph("subGraph").outV()).times(2).cap("subGraph").next();
I get the following exception:
org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Error during serialization: Class is not registered: org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph
Note: To register this class use: kryo.register(org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.class);
at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:246) ~[gremlin-driver-3.3.1.jar:3.3.1]
...
I am connecting to a remote JanusGraph 0.20 instance from Java. My client is using Tinkerpop 3.2.6. I can do all the standard stuff, return vertices, edges, etc.--When I try to build a 2 generation subgraph in starting from a known seedObject o = g.V().has("id", 1).repeat(__.bothE().subgraph(
"subGraph").outV()).times(2). cap("subGraph").next();
I get the following exception:
org.apache.tinkerpop.gremlin.
driver.exception. ResponseException: Error during serialization: Class is not registered: org.apache.tinkerpop.gremlin. tinkergraph.structure. TinkerGraph Note: To register this class use: kryo.register(org.apache.
tinkerpop.gremlin.tinkergraph. structure.TinkerGraph.class); at org.apache.tinkerpop.gremlin.
driver.Handler$ GremlinResponseHandler. channelRead0(Handler.java:246) ~[gremlin-driver-3.3.1.jar:3. 3.1] ...
This same line works fine in the gremlin console.gremlin> sg = g.V().has('id', 1).repeat(bothE().subgraph('subGraph').bothV()).times(3). cap('subGraph').next() ==>tinkergraph[vertices:4 edges:4]I am using the out of the box JanusGraph 0.20 gremlin-server.yaml and remote-objects.yaml
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/ 20afd439-3945-459a-99d4- 6fff0db56fa7%40googlegroups. com.
For more options, visit https://groups.google.com/d/optout.
I am connecting to a remote JanusGraph 0.20 instance from Java. My client is using Tinkerpop 3.2.6. I can do all the standard stuff, return vertices, edges, etc.When I try to build a 2 generation subgraph in starting from a known seedObject o = g.V().has("id", 1).repeat(__.bothE().subgraph(
"subGraph").outV()).times(2). cap("subGraph").next();
I get the following exception:
org.apache.tinkerpop.gremlin.
driver.exception. ResponseException: Error during serialization: Class is not registered: org.apache.tinkerpop.gremlin. tinkergraph.structure. TinkerGraph Note: To register this class use: kryo.register(org.apache.
tinkerpop.gremlin.tinkergraph. structure.TinkerGraph.class); at org.apache.tinkerpop.gremlin.
driver.Handler$ GremlinResponseHandler. channelRead0(Handler.java:246) ~[gremlin-driver-3.3.1.jar:3. 3.1] ...
This same line works fine in the gremlin console.gremlin> sg = g.V().has('id', 1).repeat(bothE().subgraph('subGraph').bothV()).times(3). cap('subGraph').next() ==>tinkergraph[vertices:4 edges:4]I am using the out of the box JanusGraph 0.20 gremlin-server.yaml and remote-objects.yaml
On Thursday, April 5, 2018 at 5:01:12 PM UTC-5, John Ripley wrote:
I am connecting to a remote JanusGraph 0.20 instance from Java. My client is using Tinkerpop 3.2.6. I can do all the standard stuff, return vertices, edges, etc.When I try to build a 2 generation subgraph in starting from a known seedObject o = g.V().has("id", 1).repeat(__.bothE().subgraph(
"subGraph").outV()).times(2). cap("subGraph").next();
I get the following exception:
org.apache.tinkerpop.gremlin.
driver.exception. ResponseException: Error during serialization: Class is not registered: org.apache.tinkerpop.gremlin. tinkergraph.structure. TinkerGraph Note: To register this class use: kryo.register(org.apache.
tinkerpop.gremlin.tinkergraph. structure.TinkerGraph.class); at org.apache.tinkerpop.gremlin.
driver.Handler$ GremlinResponseHandler. channelRead0(Handler.java:246) ~[gremlin-driver-3.3.1.jar:3. 3.1] ...
This same line works fine in the gremlin console.gremlin> sg = g.V().has('id', 1).repeat(bothE().subgraph('subGraph').bothV()).times(3). cap('subGraph').next() ==>tinkergraph[vertices:4 edges:4]I am using the out of the box JanusGraph 0.20 gremlin-server.yaml and remote-objects.yaml
hosts: [localhost]
port: 8182
serializer:
className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0
config:
ioRegistries:
- org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0
- org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry
Note: To register this class use:
at java.base/java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.java:412)
I was able to get it to work by including both JanusGraph and TinkerPop IoRegistries on both server and clientTinkerpop 3.2.6 on (Janus 0.2.0) gremlin server and clientgremlin-server.yaml...serializers:- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistry,org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}...remote-objects.yamlhosts: [127.0.0.1]port: 8182serializer: {className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0,config: {ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistry,org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry]}}If I include only TinkIoRegistry, it complains about not being able to handle certain JanusGraph classes. If I just include JanusGraphIoRegistry, it complains about not being able to handle certain Tinkerpop classes.Thanks for your help, Stephen
On Thursday, April 5, 2018 at 5:01:12 PM UTC-5, John Ripley wrote:I am connecting to a remote JanusGraph 0.20 instance from Java. My client is using Tinkerpop 3.2.6. I can do all the standard stuff, return vertices, edges, etc.When I try to build a 2 generation subgraph in starting from a known seedObject o = g.V().has("id", 1).repeat(__.bothE().subgraph("subGraph").outV()).times(2).cap("subGraph").next();
I get the following exception:
org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Error during serialization: Class is not registered: org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph
Note: To register this class use: kryo.register(org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.class);
at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:246) ~[gremlin-driver-3.3.1.jar:3.3.1]
...
This same line works fine in the gremlin console.gremlin> sg = g.V().has('id', 1).repeat(bothE().subgraph('subGraph').bothV()).times(3).cap('subGraph').next()==>tinkergraph[vertices:4 edges:4]I am using the out of the box JanusGraph 0.20 gremlin-server.yaml and remote-objects.yaml