Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type java.lang.Integer silently changed to int #615

Closed
hrynek opened this issue Mar 22, 2014 · 3 comments
Closed

Type java.lang.Integer silently changed to int #615

hrynek opened this issue Mar 22, 2014 · 3 comments
Assignees
Milestone

Comments

@hrynek
Copy link

hrynek commented Mar 22, 2014

In Titan 0.5 property defined as java.lang.Integer is expected to be int:

rexster[groovy]> g.makeKey("test2").dataType(java.lang.Integer.class).make();
==>test2
rexster[groovy]> g.commit()
==>null
rexster[groovy]> x = g.v(5461996204806111236)                                
==>v[5461996204806111236]
rexster[groovy]> x.test2 = 3;
==>An error occurred while processing the script for language [groovy]. All transactions across all graphs in the session have been concluded with failure: java.util.concurrent.ExecutionException: javax.script.ScriptException: javax.script.ScriptException: 
java.lang.IllegalArgumentException: Value [3] is not an instance of the expected data type for property key [test2] and cannot be converted. 
Expected: int, found: class java.lang.Integer
@mbroecheler mbroecheler added this to the Titan0.5 milestone Apr 3, 2014
@mbroecheler mbroecheler self-assigned this Apr 3, 2014
@mbroecheler
Copy link
Member

I cannot reproduce that exception in Gremlin on the current titan05 build. Can you try to reproduce?
Thanks

gremlin> g = TitanFactory.open('berkeleyje:/tmp/titan')
==>titangraph[berkeleyje:/tmp/titan]
gremlin> g.makeKey("test2").dataType(java.lang.Integer.class).make();
==>test2
gremlin> g.commit()
==>null
gremlin> x = g.addVertex()
==>v[2]
gremlin> x.test2 = 3
==>3
gremlin> x.getProperty('test2')
==>3
gremlin> g.commit()
==>null
gremlin> g.V.map
WARN  com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx  - Query requires iterating over all vertices [()]. For better performance, use indexes
==>{test2=3}

@ksmets
Copy link

ksmets commented Jul 22, 2014

Have the same issue when running titan05 build in storm topology in production. It also complains about

java.lang.RuntimeException: java.lang.IllegalArgumentException: Value [1] is not an instance of the expected data type for property key [count] and cannot be converted. Expected: int, found: class java.lang.Integer

@ksmets
Copy link

ksmets commented Jul 22, 2014

I figured out what is likely causing the issue... it's related to different version of the kryo serialization library. storm-incubating-0.9.2 uses kryo-2.21 while titan05 depends on kryo-2.22.

If you downgrade titan dependency to kryo-2.21, you can reproduce the silent int vs java.lang.Integer error. If you there is version mismatch you get java.lang.RuntimeException: com.esotericsoftware.kryo.KryoException: Encountered unregistered class ID: 10 in storm.

The solution, for me at least, is to upgrade storm's kryo dependency to 2.22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants