We are using CompatibleSerializer and we see that in few cases Kryo fails to deserialize the data that it serialized.(Serialized data is written into memcache)com.esotericsoftware.kryo.KryoException: Encountered unregistered class ID: 65at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:119)at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:656)at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:767)How should one go about debugging this?I enabled Kryo tracing and see this00:01 TRACE: [kryo] Write initial object reference 65: jpg00:01 TRACE: [kryo] Write: jpgAm I right in mapping class ID 65 in exception trace to this output?
Any pointers on how to analyze ' unregistered class ID' would be helpful.
Thanks Leo.Here is how we have configured kryo (using CompatibleFieldSerializer) -private static ThreadLocal<Kryo> compatibleKryo = new ThreadLocal<Kryo>() {@Overrideprotected Kryo initialValue() {Kryo kryo = new Kryo();kryo.setDefaultSerializer(CompatibleFieldSerializer.class);return kryo;}};
and we have a custom transcoder for memcache which serializes and deserializes cache data using kryo.We don't register any classes explicitly and rely on Kryo implicit registration. And we are seeing that in few cases, we see Kryo write happening fine (checked via Kryo trace), but when that same data is being read by Kryo it fails with this error (we use readClassAndObject and writeClassAndObject)We also see a pattern in these errors where kryo fails to read what it wrote. The data typically has either html entities (&) or Unicode (non english characters)in fact in one of the cases, we started skipping I18n data and kryo deserialization started working!Is there something specific to be done in terms of handling these? (Does Kryo interpret & etc in some other way?)Looked at the StringSerailizer in Kryo and it seems to be handing Unicode fine.
Can you send the exact declaration of Foo and Bean? A clue can be in the class declaration (inheritance)?
--
You received this message because you are subscribed to the "kryo-users" group.
http://groups.google.com/group/kryo-users
---
You received this message because you are subscribed to the Google Groups "kryo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kryo-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
This looks like Kryo is confused. Possible causes:
1) The serialized stream was written by a different version of Kryo than
you're using to read it.
2) A bug in Kryo (nested classes are somewhat special).
3) Something interfering with the data stream, e.g. something that
recodes UTF-8 to Latin-1.
4) There's also the possibility that something odd is going on with your
nested class. If I recall correctly, nested class name mangling isn't
standardized, so if the Kryo stream was written by a different kind of
JVM than what's running your Tomcat, you might be in trouble, too. (This
is a rather vague possibility, I just mention it in case your setup is
way more complicated than usual.)
If it's not (1), you'll need to strip the code to the minimum that can
reproduce the problem to find the cause.