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

Odd error calling NoSuchMethodError on com.esotericsoftware.kryo.Kryo.setInstantiatorStrategy #209

Open
olliefreeman opened this issue Dec 9, 2014 · 9 comments

Comments

@olliefreeman
Copy link

This is being run from Spark.

Actually scrolling through the code I have no idea why we are getting this, seems to have arisen since our development project included titan which has set the kyro version on the class path to 2.222

java.lang.NoSuchMethodError: com.esotericsoftware.kryo.Kryo.setInstantiatorStrategy(Lorg/objenesis/strategy/InstantiatorStrategy;)V
    at com.twitter.chill.KryoBase.setInstantiatorStrategy(KryoBase.scala:86) ~[chill_2.10-0.5.1.jar:0.5.1]
    at com.twitter.chill.EmptyScalaKryoInstantiator.newKryo(ScalaKryoInstantiator.scala:59) ~[chill_2.10-0.5.1.jar:0.5.1]
    at org.apache.spark.serializer.KryoSerializer.newKryo(KryoSerializer.scala:62) ~[spark-core_2.10-1.1.1.jar:1.1.1]
    at org.apache.spark.serializer.KryoSerializerInstance.<init>(KryoSerializer.scala:148) ~[spark-core_2.10-1.1.1.jar:1.1.1]
    at org.apache.spark.serializer.KryoSerializer.newInstance(KryoSerializer.scala:110) ~[spark-core_2.10-1.1.1.jar:1.1.1]

Annoyingly given our current setup the titan dependencies have to be on the same class path so I'm going to be trying titan using 2.21 and also raising an issue in kryo to find out where it was moved to or why it was just removed, but I thought i would point this out for you guys to know about it.

@olliefreeman olliefreeman changed the title Removed API method call in kryo 2.22 which chill uses - Kryo.setInstantiatorStrategy Odd error calling NoSuchMethodError on com.esotericsoftware.kryo.Kryo.setInstantiatorStrategy Dec 9, 2014
@johnynek
Copy link
Collaborator

I think what happened is that it went from returning void to returning boolean.

The diamond pains here are no joke, but since Kryo is used by many low-layer systems without any classloaders, we get into pain. Storm, Scalding, Spark all use it.

@steveloughran
Copy link

It is a signature change, but not the return value. The type of the argument to setInstantiatorStrategy changed between 2.21 to 2.22; as the package of InstantiatorStrategy moved from org.objenesis.strategy to com.esotericsoftware.shaded.org.objenesis.strategy -the objenesis library was shaded.

This is the stack trace you see if you are running code built against 2.21 (here. Chill 0.50) with Kryo 2.22 on the classpath and something tries to set the instantiator strategy.

@MielHostens
Copy link

Anybody shortcut to get this error out of Jupyter-Spark1.5.2 on HD Insights
java.lang.NoSuchMethodError: com.esotericsoftware.kryo.Kryo.setInstantiatorStrategy(Lorg/objenesis/strategy/InstantiatorStrategy

@johnynek
Copy link
Collaborator

johnynek commented Jan 7, 2017 via email

@MielHostens
Copy link

What do you need as input from me?

@johnynek
Copy link
Collaborator

johnynek commented Jan 7, 2017 via email

@MielHostens
Copy link

Hmm, i guess hd insights is hdp -hortonworks cluster, so i would have to dive in, any suggestions were to look for ?

@MielHostens
Copy link

talking about chill here
https://issues.apache.org/jira/browse/PIG-4693

@MielHostens
Copy link

Solved
sudo rm /usr/bin/livy/jars/kryo-2.22.jar
replace with kryo-2.21.jar

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

4 participants