-
Notifications
You must be signed in to change notification settings - Fork 13
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
problem when serializing object #8
Comments
@tamerh: thanks for this report. it indeed looks like an issue in Kryo. Can you share the object you are trying to serialize? |
are you using guava collections? |
thanks for the quick repyl @jerrinot my object is like following. I am casting different object to the cachedObject and i suspect kryo does not like this. is it possible? and no i am not using guava libiraries `public class CacheObject implements Serializable {
}` |
maybe. I am not sure, unfortunately I don't know Kryo internals good enough to be able to tell. |
from the limited logs the suspicous part is a unmodifiable List. i am creating a unmodifiable string list via Collections.unmodifiableList() and then assign it to the List do you think this should be declared or serialized in special way? |
yeah, apparently
|
Great! i am going to try the master. is this need any extra configuration? |
in the simplest case you only need to create
However in this case it appears to be little more complicated as the unmodifieable class are not public - they are always constructed via a factory method ( I guess you will need to create own serialization subclass and do a programmatic registration. Currently this is not documented yet. This discussion could help you a bit. This is going against the main idea of SubZero: It should be dead-simple and apparently it is not simple in your case. I'll try to improve it when I have time. |
ok, I have an idea how to make it simpler. It should be a simple as including the serializer class inside the
Note there is no The SubZero can figure out this is a serializer which does require special registration as documented at I'll try to implement it and push to master today evening (in Europe) |
sounds great @jerrinot . Just how can set the |
the file has to be on your classpath. that's the only strategy as of now. I might add another strategies, perhaps an external file could be useful in some cases. You can use the |
@tamerh: I just pushed a change into the master branch. It should be as simple as having
Obviously the kryo-serializers have to be on your classpath. You can use these Maven coordinates:
I noticed a bug in the |
although i have updated the master and clean mvn repo and configure |
@tamerh: I pushed another update. |
if you are going to debug it then this is a good starting point: subzero/subzero-core/src/main/java/info/jerrinot/subzero/internal/PropertyUserSerializer.java Line 53 in 3d844c3
|
Hi @jerrinot today i have tried this again with proper setting and i got following exception any idea for the reason? Thanks |
@tamerh: can you check your are using the latest revision? this appears to be from an older version. |
@jerrinot Is there any release date for 0.7 version with this |
@brunoml: I can do that this weekend. Can you please try the latest SNAPSHOT version and confirm it's working for you? |
I'll try the the latest SNAPSHOT version today and put the result here. |
@jerrinot I tried the master and |
I just released SubZero v0.7. |
Hello,
i am getting following exception while desalinizing my java object which is working with default java serialization. Problem is happening when i get my object from client putting the object seems ok.
it can be related with kryo but maybe you have an idea.Thanks in advance
at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:144) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.internal.strategy.GlobalKryoStrategy.readObject(GlobalKryoStrategy.java:18) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.internal.strategy.KryoStrategy.read(KryoStrategy.java:76) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.Serializer.read(Serializer.java:40) ~[subzero-all-0.6.jar:na] at com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.read(StreamSerializerAdapter.java:46) ~[hazelcast-3.7.2.jar:3.7.2] at com.hazelcast.internal.serialization.impl.AbstractSerializationService.toObject(AbstractSerializationService.java:172) ~[hazelcast-3.7.2.jar:3.7.2] ... 8 common frames omitted Caused by: java.lang.UnsupportedOperationException: null at java.util.Collections$UnmodifiableCollection.add(Collections.java:1055) ~[na:1.8.0_65] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:134) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:40) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[subzero-all-0.6.jar:na] at info.jerrinot.subzero.relocated.com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[subzero-all-0.6.jar:na]
The text was updated successfully, but these errors were encountered: