Custom attribute serializer

83 views
Skip to first unread message

Erik Mocný

unread,
Jul 27, 2016, 8:56:49 AM7/27/16
to Aurelius
Hi there,

I'm using titan-1.0.0 (but tried also curren SNAPSHOT) and I want to use custom attributes serializer.

I've done everything I can imagine and read through these forums but I still got this exception when I try to load and start titan: 

1270 [main] WARN  org.apache.tinkerpop.gremlin.server.GremlinServer  - Graph [graph] configured at [conf/gremlin-server/titan-cassandra-server.properties] could not be instantiated and will not be available in Gremlin Server.  GraphFactory message: GraphFactory could not instantiate this Graph implementation [class com.thinkaurelius.titan.core.TitanFactory]
java
.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [class com.thinkaurelius.titan.core.TitanFactory]
 at org
.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:82)
 at org
.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:70)
 at org
.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:104)
 at org
.apache.tinkerpop.gremlin.server.GraphManager.lambda$new$27(GraphManager.java:50)
 at java
.util.LinkedHashMap$LinkedEntrySet.forEach(LinkedHashMap.java:663)
 at org
.apache.tinkerpop.gremlin.server.GraphManager.<init>(GraphManager.java:48)
 at org
.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:94)
 at org
.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:88)
 at org
.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.java:290)
Caused by: java.lang.reflect.InvocationTargetException
 at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java
.lang.reflect.Method.invoke(Method.java:497)
 at org
.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:78)
 
... 8 more
Caused by: java.lang.IllegalStateException: Need to set configuration value: root.attributes.custom.attribute-class
 at com
.google.common.base.Preconditions.checkState(Preconditions.java:197)
 at com
.thinkaurelius.titan.diskstorage.configuration.ConfigOption.get(ConfigOption.java:216)
 at com
.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration.get(BasicConfiguration.java:56)
 at com
.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1390)
 at com
.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:94)
 at com
.thinkaurelius.titan.core.TitanFactory.open(TitanFactory.java:74)
 
... 13 more

I'm using serializers and settings from this github project.

Is there someone who passed this issue? 

If I look and read documentation everything looks correct.

Jason Plurad

unread,
Jul 27, 2016, 9:59:50 AM7/27/16
to Aurelius
Hi Erik,

You'll run into that error (java.lang.IllegalStateException: Need to set configuration value: root.attributes.custom.attribute-class
)
when trying to connect to an existing keyspace that didn't have the serializers defined previously. I'd suggest that you drop the keyspace and create a new one.

-- Jason

Erik Mocný

unread,
Jul 27, 2016, 10:57:52 AM7/27/16
to Aurelius
Hi Jason,

Everything works now, I had to manually drop keyspace with cqlsh in cassandra container.
Don't realize that 'cause the exception was really misleading :/ 

Thank you very much

EM

Dňa streda, 27. júla 2016 15:59:50 UTC+2 Jason Plurad napísal(-a):

Erik Mocný

unread,
Jul 29, 2016, 3:54:49 AM7/29/16
to Aurelius
Hi Jason,

I've run into another issue when I finally wrote my tests against titan from real app (not just HashMap property test in gremlin-console).

From app tests I got the following exception:

java.lang.IllegalArgumentException: Not a supported data type: class java.util.HashMap

I'm assuming that titan wont register this new custom datatype but don't understand why is it so. 

EM

Dňa streda, 27. júla 2016 15:59:50 UTC+2 Jason Plurad napísal(-a):
Hi Erik,

Erik Mocný

unread,
Jul 29, 2016, 4:08:33 AM7/29/16
to Aurelius
Ok,

I've resolved this issue also.

I had to first add custom attributes through mgmt system and after that I was success with adding HashMap property :)

Dňa piatok, 29. júla 2016 9:54:49 UTC+2 Erik Mocný napísal(-a):
Reply all
Reply to author
Forward
0 new messages