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










share|improve this question




























    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










    share|improve this question


























      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










      share|improve this question















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 12 hours ago

























      asked 13 hours ago









      ptc

      1597




      1597
























          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();
          }





          share|improve this answer





















          • Thanks Stephen, that worked!. Also much appreciate advice on code which we have taken on board.
            – ptc
            1 hour ago











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          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
































          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();
          }





          share|improve this answer





















          • Thanks Stephen, that worked!. Also much appreciate advice on code which we have taken on board.
            – ptc
            1 hour ago















          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();
          }





          share|improve this answer





















          • Thanks Stephen, that worked!. Also much appreciate advice on code which we have taken on board.
            – ptc
            1 hour ago













          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();
          }





          share|improve this answer












          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();
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          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


















          • 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


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          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




















































































          Popular posts from this blog

          Schultheiß

          Liste der Kulturdenkmale in Wilsdruff

          Android Play Services Check