Janusgraph 0.3.0 Tinkerpop 3.3.3 java - serialization error after adding Edge using GryoMessageSerializerV3d0
up vote
0
down vote
favorite
I get the following error after adding an edge in Java:
16:40:44.267 [gremlin-driver-loop-1] WARN org.apache.tinkerpop.gremlin.driver.MessageSerializer - Response [PooledUnsafeDirectByteBuf(ridx: 98, widx: 98, cap: 98)] could not be deserialized by org.apache.tinkerpop.gremlin.driver.ser.AbstractGryoMessageSerializerV3d0.
org.apache.tinkerpop.shaded.kryo.KryoException: Encountered unregistered class ID: 65536
Serialization trace:
id (org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdge)
at org.apache.tinkerpop.gremlin.structure.io.gryo.AbstractGryoClassResolver.readClass(AbstractGryoClassResolver.java:148)
Janusgraph version is 0.3.0, Tinkerpop version is 3.3.3, the Janusgraph serialization configuration is as follows:
>
serializers:
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
# Older serialization versions for backwards compatibility:
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: {ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
The following error is logged on the server at about the same time and appears to be related:
>
105869 2018-11-08 06:10:44,659 [gremlin-server-worker-1] WARN io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
As far as I can see I have my ducks lined up in terms of matching serializer versions but clearly must have missed something. Any assistance greatly appreciated!
The code can be seen here:
https://gist.github.com/ptclarke/45472fa5c268a6e8441e4c35615194aa
janusgraph
add a comment |
up vote
0
down vote
favorite
I get the following error after adding an edge in Java:
16:40:44.267 [gremlin-driver-loop-1] WARN org.apache.tinkerpop.gremlin.driver.MessageSerializer - Response [PooledUnsafeDirectByteBuf(ridx: 98, widx: 98, cap: 98)] could not be deserialized by org.apache.tinkerpop.gremlin.driver.ser.AbstractGryoMessageSerializerV3d0.
org.apache.tinkerpop.shaded.kryo.KryoException: Encountered unregistered class ID: 65536
Serialization trace:
id (org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdge)
at org.apache.tinkerpop.gremlin.structure.io.gryo.AbstractGryoClassResolver.readClass(AbstractGryoClassResolver.java:148)
Janusgraph version is 0.3.0, Tinkerpop version is 3.3.3, the Janusgraph serialization configuration is as follows:
>
serializers:
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
# Older serialization versions for backwards compatibility:
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: {ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
The following error is logged on the server at about the same time and appears to be related:
>
105869 2018-11-08 06:10:44,659 [gremlin-server-worker-1] WARN io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
As far as I can see I have my ducks lined up in terms of matching serializer versions but clearly must have missed something. Any assistance greatly appreciated!
The code can be seen here:
https://gist.github.com/ptclarke/45472fa5c268a6e8441e4c35615194aa
janusgraph
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I get the following error after adding an edge in Java:
16:40:44.267 [gremlin-driver-loop-1] WARN org.apache.tinkerpop.gremlin.driver.MessageSerializer - Response [PooledUnsafeDirectByteBuf(ridx: 98, widx: 98, cap: 98)] could not be deserialized by org.apache.tinkerpop.gremlin.driver.ser.AbstractGryoMessageSerializerV3d0.
org.apache.tinkerpop.shaded.kryo.KryoException: Encountered unregistered class ID: 65536
Serialization trace:
id (org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdge)
at org.apache.tinkerpop.gremlin.structure.io.gryo.AbstractGryoClassResolver.readClass(AbstractGryoClassResolver.java:148)
Janusgraph version is 0.3.0, Tinkerpop version is 3.3.3, the Janusgraph serialization configuration is as follows:
>
serializers:
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
# Older serialization versions for backwards compatibility:
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: {ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
The following error is logged on the server at about the same time and appears to be related:
>
105869 2018-11-08 06:10:44,659 [gremlin-server-worker-1] WARN io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
As far as I can see I have my ducks lined up in terms of matching serializer versions but clearly must have missed something. Any assistance greatly appreciated!
The code can be seen here:
https://gist.github.com/ptclarke/45472fa5c268a6e8441e4c35615194aa
janusgraph
I get the following error after adding an edge in Java:
16:40:44.267 [gremlin-driver-loop-1] WARN org.apache.tinkerpop.gremlin.driver.MessageSerializer - Response [PooledUnsafeDirectByteBuf(ridx: 98, widx: 98, cap: 98)] could not be deserialized by org.apache.tinkerpop.gremlin.driver.ser.AbstractGryoMessageSerializerV3d0.
org.apache.tinkerpop.shaded.kryo.KryoException: Encountered unregistered class ID: 65536
Serialization trace:
id (org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdge)
at org.apache.tinkerpop.gremlin.structure.io.gryo.AbstractGryoClassResolver.readClass(AbstractGryoClassResolver.java:148)
Janusgraph version is 0.3.0, Tinkerpop version is 3.3.3, the Janusgraph serialization configuration is as follows:
>
serializers:
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
# Older serialization versions for backwards compatibility:
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: {ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
- { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
The following error is logged on the server at about the same time and appears to be related:
>
105869 2018-11-08 06:10:44,659 [gremlin-server-worker-1] WARN io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
As far as I can see I have my ducks lined up in terms of matching serializer versions but clearly must have missed something. Any assistance greatly appreciated!
The code can be seen here:
https://gist.github.com/ptclarke/45472fa5c268a6e8441e4c35615194aa
janusgraph
janusgraph
edited 12 hours ago
asked 13 hours ago
ptc
1597
1597
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
I think you need the JanusGraphIoRegistry
registered on the client side:
GryoMapper.Builder builder = GryoMapper.build().
addRegistry(JanusGraphIoRegistry.getInstance());
GryoMessageSerializerV3d0 serializer = new GryoMessageSerializerV3d0(builder);
Cluster cluster = Cluster.build().
addContactPoint(host).
port(port).
serializer(serializer).
create();
As some additional advice on your code. Consider avoiding lots of small updates like this:
public void updateVertex(Vertex v, Map<Object, Object> propertyMap){
for(Entry<Object, Object> e : propertyMap.entrySet()) {
g.V(v).property(e.getKey(), e.getValue()).next();
}
}
and instead do:
public void updateVertex(Vertex v, Map<Object, Object> propertyMap){
GraphTraversal<Vertex,Vertex> t = g.V(v);
for(Entry<Object, Object> e : propertyMap.entrySet()) {
t = t.property(e.getKey(), e.getValue());
}
t.iterate();
}
You can also simplify your "add edge" code:
public Edge addEdge(String label, Vertex from, Vertex to) {
return g.V(from).addE(label).to(to).next();
}
Thanks Stephen, that worked!. Also much appreciate advice on code which we have taken on board.
– ptc
1 hour ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
I think you need the JanusGraphIoRegistry
registered on the client side:
GryoMapper.Builder builder = GryoMapper.build().
addRegistry(JanusGraphIoRegistry.getInstance());
GryoMessageSerializerV3d0 serializer = new GryoMessageSerializerV3d0(builder);
Cluster cluster = Cluster.build().
addContactPoint(host).
port(port).
serializer(serializer).
create();
As some additional advice on your code. Consider avoiding lots of small updates like this:
public void updateVertex(Vertex v, Map<Object, Object> propertyMap){
for(Entry<Object, Object> e : propertyMap.entrySet()) {
g.V(v).property(e.getKey(), e.getValue()).next();
}
}
and instead do:
public void updateVertex(Vertex v, Map<Object, Object> propertyMap){
GraphTraversal<Vertex,Vertex> t = g.V(v);
for(Entry<Object, Object> e : propertyMap.entrySet()) {
t = t.property(e.getKey(), e.getValue());
}
t.iterate();
}
You can also simplify your "add edge" code:
public Edge addEdge(String label, Vertex from, Vertex to) {
return g.V(from).addE(label).to(to).next();
}
Thanks Stephen, that worked!. Also much appreciate advice on code which we have taken on board.
– ptc
1 hour ago
add a comment |
up vote
3
down vote
accepted
I think you need the JanusGraphIoRegistry
registered on the client side:
GryoMapper.Builder builder = GryoMapper.build().
addRegistry(JanusGraphIoRegistry.getInstance());
GryoMessageSerializerV3d0 serializer = new GryoMessageSerializerV3d0(builder);
Cluster cluster = Cluster.build().
addContactPoint(host).
port(port).
serializer(serializer).
create();
As some additional advice on your code. Consider avoiding lots of small updates like this:
public void updateVertex(Vertex v, Map<Object, Object> propertyMap){
for(Entry<Object, Object> e : propertyMap.entrySet()) {
g.V(v).property(e.getKey(), e.getValue()).next();
}
}
and instead do:
public void updateVertex(Vertex v, Map<Object, Object> propertyMap){
GraphTraversal<Vertex,Vertex> t = g.V(v);
for(Entry<Object, Object> e : propertyMap.entrySet()) {
t = t.property(e.getKey(), e.getValue());
}
t.iterate();
}
You can also simplify your "add edge" code:
public Edge addEdge(String label, Vertex from, Vertex to) {
return g.V(from).addE(label).to(to).next();
}
Thanks Stephen, that worked!. Also much appreciate advice on code which we have taken on board.
– ptc
1 hour ago
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
I think you need the JanusGraphIoRegistry
registered on the client side:
GryoMapper.Builder builder = GryoMapper.build().
addRegistry(JanusGraphIoRegistry.getInstance());
GryoMessageSerializerV3d0 serializer = new GryoMessageSerializerV3d0(builder);
Cluster cluster = Cluster.build().
addContactPoint(host).
port(port).
serializer(serializer).
create();
As some additional advice on your code. Consider avoiding lots of small updates like this:
public void updateVertex(Vertex v, Map<Object, Object> propertyMap){
for(Entry<Object, Object> e : propertyMap.entrySet()) {
g.V(v).property(e.getKey(), e.getValue()).next();
}
}
and instead do:
public void updateVertex(Vertex v, Map<Object, Object> propertyMap){
GraphTraversal<Vertex,Vertex> t = g.V(v);
for(Entry<Object, Object> e : propertyMap.entrySet()) {
t = t.property(e.getKey(), e.getValue());
}
t.iterate();
}
You can also simplify your "add edge" code:
public Edge addEdge(String label, Vertex from, Vertex to) {
return g.V(from).addE(label).to(to).next();
}
I think you need the JanusGraphIoRegistry
registered on the client side:
GryoMapper.Builder builder = GryoMapper.build().
addRegistry(JanusGraphIoRegistry.getInstance());
GryoMessageSerializerV3d0 serializer = new GryoMessageSerializerV3d0(builder);
Cluster cluster = Cluster.build().
addContactPoint(host).
port(port).
serializer(serializer).
create();
As some additional advice on your code. Consider avoiding lots of small updates like this:
public void updateVertex(Vertex v, Map<Object, Object> propertyMap){
for(Entry<Object, Object> e : propertyMap.entrySet()) {
g.V(v).property(e.getKey(), e.getValue()).next();
}
}
and instead do:
public void updateVertex(Vertex v, Map<Object, Object> propertyMap){
GraphTraversal<Vertex,Vertex> t = g.V(v);
for(Entry<Object, Object> e : propertyMap.entrySet()) {
t = t.property(e.getKey(), e.getValue());
}
t.iterate();
}
You can also simplify your "add edge" code:
public Edge addEdge(String label, Vertex from, Vertex to) {
return g.V(from).addE(label).to(to).next();
}
answered 7 hours ago
stephen mallette
24k32673
24k32673
Thanks Stephen, that worked!. Also much appreciate advice on code which we have taken on board.
– ptc
1 hour ago
add a comment |
Thanks Stephen, that worked!. Also much appreciate advice on code which we have taken on board.
– ptc
1 hour ago
Thanks Stephen, that worked!. Also much appreciate advice on code which we have taken on board.
– ptc
1 hour ago
Thanks Stephen, that worked!. Also much appreciate advice on code which we have taken on board.
– ptc
1 hour ago
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53202745%2fjanusgraph-0-3-0-tinkerpop-3-3-3-java-serialization-error-after-adding-edge-us%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password