Kryo serializers seem to work locally, but they're not found on the remote cluster when needed for deserialization.
The test case shows that the serializer works:
mvn test
Run locally to see that the AModel
s are properly serialized and deserialized:
mvn package exec:java
Run remotely to see the worker die that's running PrinterBolt
:
storm jar target/storm-kryo-test-1.0-jar-with-dependencies.jar com.mkscrg.sandbox.StormKryoTestTopology kryo-test
Here's the stack trace I'm seeing on the cluster:
2012-07-20 16:34:06 util [ERROR] Async loop died!
java.lang.RuntimeException: com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg constructor): com.mkscrg.sandbox.AModel
at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:79)
at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:53)
at backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:45)
at backtype.storm.disruptor$consume_loop_STAR_$fn__1613.invoke(disruptor.clj:56)
at backtype.storm.util$async_loop$fn__465.invoke(util.clj:377)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg constructor): com.mkscrg.sandbox.AModel
at com.esotericsoftware.kryo.Kryo.newInstantiator(Unknown Source)
at com.esotericsoftware.kryo.Kryo.newInstance(Unknown Source)
at com.esotericsoftware.kryo.Serializer.create(Unknown Source)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Unknown Source)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(Unknown Source)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(Unknown Source)
at com.esotericsoftware.kryo.Kryo.readObject(Unknown Source)
at backtype.storm.serialization.KryoValuesDeserializer.deserializeFrom(KryoValuesDeserializer.java:20)
at backtype.storm.serialization.KryoTupleDeserializer.deserialize(KryoTupleDeserializer.java:36)
at backtype.storm.daemon.executor$mk_task_receiver$fn__3955.invoke(executor.clj:303)
at backtype.storm.disruptor$clojure_handler$reify__1601.onEvent(disruptor.clj:32)
at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:76)
... 6 more
2012-07-20 16:34:06 executor [ERROR]
java.lang.RuntimeException: com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg constructor): com.mkscrg.sandbox.AModel
at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:79)
at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:53)
at backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:45)
at backtype.storm.disruptor$consume_loop_STAR_$fn__1613.invoke(disruptor.clj:56)
at backtype.storm.util$async_loop$fn__465.invoke(util.clj:377)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg constructor): com.mkscrg.sandbox.AModel
at com.esotericsoftware.kryo.Kryo.newInstantiator(Unknown Source)
at com.esotericsoftware.kryo.Kryo.newInstance(Unknown Source)
at com.esotericsoftware.kryo.Serializer.create(Unknown Source)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Unknown Source)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(Unknown Source)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(Unknown Source)
at com.esotericsoftware.kryo.Kryo.readObject(Unknown Source)
at backtype.storm.serialization.KryoValuesDeserializer.deserializeFrom(KryoValuesDeserializer.java:20)
at backtype.storm.serialization.KryoTupleDeserializer.deserialize(KryoTupleDeserializer.java:36)
at backtype.storm.daemon.executor$mk_task_receiver$fn__3955.invoke(executor.clj:303)
at backtype.storm.disruptor$clojure_handler$reify__1601.onEvent(disruptor.clj:32)
at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:76)
... 6 more