Hi Wladimir,
On 05/09/2016 11:23 AM, Wladimir Schamai wrote:
> Hi all,
>
> We use Kryo 3.0.3, everything works fine except the fact that from time
> to time deserialization fails with
> _"com.esotericsoftware.kryo.KryoException_: Encountered unregistered
> class ID:".
> It happens sporadically with exactly the same input data.
Is it really sometimes working and sometimes not with exactly the same
input data?
Then you'd be able to successfully deserialize input data that sometimes
fails. You could serialize and deserialize such an object graph using
trace logging (just set minlog's Log.TRACE() before).
> It is not easy to reproduce, it happens to be non-deterministic. Has
> somebody experienced similar issues?
> Any recommendation where to start debugging?
Do you register classes explicitely with Kryo, or is this happening
implicitely? Registering class explicitely
(+Kryo.setRegistrationRequired(true)) is always a good idea, especially
if you serialize and deserialize using different Kryo instances (and may
be on different machines). Explicit registration ensures deterministic
results, because all instances of Kryo would register the same classes
in the same order and assign the same integer IDs to them.
If you want to see which classes are registered you have to set a custom
class resolver (because there's no public access to the registrations),
like this:
class ExtClassResolver extends DefaultClassResolver {
Iterable<Registration> getRegistrations() {
return super.idToRegistration.values();
}
}
ExtClassResolver cr = new ExtClassResolver();
Kryo kryo = new Kryo(cr, new MapReferenceResolver());
// ...(de)serialize...
// print registered classes from cr.getRegistrations()...
You can also search for similar issues and see what others did
(
https://github.com/EsotericSoftware/kryo/issues?utf8=%E2%9C%93&q=is%3Aissue+%22Encountered+unregistered+class+ID%22).
Cheers,
Martin
> I appreciate your support!
> Wladimir
>
> --
> 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
> <mailto:
kryo-users+...@googlegroups.com>.
> For more options, visit
https://groups.google.com/d/optout.