JanusGraph / JanusGraph/janusgraph
schema-related classes are not serializable over remote connection
- Dominant language
- Java
- Stars
- 5.8k
- Forks
- 1.2k
- Avg merge
- 13h 53m
- Merged PRs (30d)
- 6
Description
Using JanusGraph 0.3.0 distribution, update the `conf/remote.yaml` to use Gryo with Objects instead of String
```
hosts: [localhost]
port: 8182
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
```
Then create a PropertyKey in the schema and try to return its Cardinality
```
gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Configured localhost/127.0.0.1:8182-[3f6c9ae9-9ff3-4a92-8b9f-9d997a426436]
gremlin> :> l = []; mgmt = graph.openManagement(); mgmt.makePropertyKey('name').dataType(String.class).make(); mgmt.commit(); l
gremlin> :> l = []; mgmt = graph.openManagement(); l << mgmt.getPropertyKey('name').cardinality(); mgmt.rollback(); l
Server could not serialize the result requested. Server error - Error during serialization: Class is not registered: org.janusgraph.core.Cardinality
Note: To register this class use: kryo.register(org.janusgraph.core.Cardinality.class);. Note that the class must be serializable by the client and server for proper operation.
Type ':help' or ':h' for help.
Display stack trace? [yN]y
org.apache.tinkerpop.gremlin.jsr223.console.RemoteException: Server could not serialize the result requested. Server error - Error during serialization: Class is not registered: org.janusgraph.core.Cardinality
Note: To register this class use: kryo.register(org.janusgraph.core.Cardinality.class);. Note that the class must be serializable by the client and server for proper operation.
at org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:176)
at org.apache.tinkerpop.gremlin.console.commands.SubmitCommand.execute(SubmitCommand.groovy:41)
at org.codehaus.groovy.tools.shell.Shell.execute(Shell.groovy:104)
```
A workaround is to return a String result instead
```
gremlin> :> l = []; mgmt = graph.openManagement(); l << mgmt.getPropertyKey('name').cardinality(); mgmt.rollback(); l[0].toString()
==>SINGLE
```
Contributor guide
Research direction
Start by reproducing the failure with conf/remote.yaml and the Gremlin console commands shown in the issue. Trace serialization of the returned Cardinality value and compare it with the String workaround; done means the schema-related result can be returned over the configured remote connection without a serialization error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100