Open iicreator opened 4 months ago
Thanks for the detailed report.
What error message are you seeing? Is your issue the same as #907?
Thanks for the detailed report.
What error message are you seeing? Is your issue the same as #907?
com.esotericsoftware.kryo.KryoException: Unable to read unknown data, type: java.util.ArrayList (com.test.PoJo#null) at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:157)
yes, it's the same. However, I think this is irrelevant to ChunkedEncoding, probably a bug.
Can you test if the problem goes away with chunked encoding?
You could also try disabling generics optimization with kryo.setOptimizedGenerics(false);
.
This is definitely a bug, but one that is difficult to resolve and that I already spent a couple of hours on in the past without success. I can't spend any more time on this at the moment but I'd be happy to accept a pull request.
Can you test if the problem goes away with chunked encoding?
You could also try disabling generics optimization with
kryo.setOptimizedGenerics(false);
.This is definitely a bug, but one that is difficult to resolve and that I already spent a couple of hours on in the past without success. I can't spend any more time on this at the moment but I'd be happy to accept a pull request.
Thanks for help. Chunked Encoding is useless, but kryo.setOptimizedGenerics(false) is useful.
Describe the bug
When serializing, the entity used has one additional field of type List compared to the entity used for deserialization, which throw an Exception during deserialization. I think the CompatibleFieldSerializer is supposed to handle the addition of new fields, so this situation does not meet expectations.
After briefly examining the Kryo source code, I found that the CollectionSerializer, when serializing, does not write the elementType if it has access to the elementSerializer, and uses kryo.writeObject to write the element. However, during deserialization, kryo.getGenerics().nextGenericClass() returns null and the elementSerializer cannot be obtained, so kryo.readClassAndObject is used to read, which seems to be causing the problem.
To Reproduce Please delete PoJo.list when deserializing
Environment:
Additional context Add any other context about the problem here.