Open GoogleCodeExporter opened 8 years ago
Tried
m_kryo.register(someclassB.class, 111);
m_kryo.register(someclassA.class, 112);
m_kryo.register(someclassC.class, 113);
"Encountered unregistered class ID: 121", same error.
Original comment by me...@ntlworld.com
on 11 Mar 2013 at 12:03
m_kryo.register(someclassB.class);
m_kryo.register(someclassA.class);
m_kryo.register(someclassC.class);
"Encountered unregistered class ID: 121", same error.
Also with v2.20
Original comment by me...@ntlworld.com
on 11 Mar 2013 at 1:19
Did a test where I didn't register anything, just a straight call.
On the PC when reading the file I get.
Error: Unable to find class: SomeValueDataInTheObject
Serialization trace:
values (someclassB)
fields (someclassA)
Seems like its reading data from the wrong place in the file.
I created the file on the Device then copied it over to the PC via USB.
I'm guessing that its to-do with byte formatting ?
If so then I guess the way around it would be to convert it on the device to a
more acceptable format before it gets passed over.
Original comment by me...@ntlworld.com
on 11 Mar 2013 at 5:22
[deleted comment]
Seems while its quite happy to save/load List<Obj> on the same device/pc. When
you move the file to either side it fails, it seems to loose its way while
reading the file even if you register all the required class's.
For example I created a file on the PC, copied it over to the device. The
Strings in the List were prefixed with a square unprintable byte. The other way
about resulted in the error I mentioned before, "Error: Unable to find class:
SomeValueDataInTheObject" where some of the data was mistaken for a class.
I had List problems to begin with due to Array.asList being immutable so I
stopped using it. Then things seems to save/load ok, it wasn't until I tried to
read the file on the PC that I came across the errors I first encountered.
I have stripped it back to basics using just a primitive array String[] and
Object[] and now it all seems to be working as expected.
Original comment by me...@ntlworld.com
on 12 Mar 2013 at 2:25
Hi,
Reading your bug report, I assume that reading/writing on the same platform
works properly. Only if you move the serialized file to a different platform it
starts misbehaving. Is it correct?
If so, I would suspect that this problem could be related to byte ordering,
which could be different on those devices.
BTW, have you tried to use v2.21 or current trunk? Is it any better?
-Leo
Original comment by romixlev
on 23 Jul 2013 at 9:06
Yes, save the object with a List in on Android. Fails to open in the Windows
Java app but opens fine in Android.
Yes, I too think its probably got something to-do with byte ordering.
As I said thou I've worked around it by stripping back to basic primitives.
I was using 2.21 as mentioned in the first part.
Original comment by me...@ntlworld.com
on 23 Jul 2013 at 12:48
OK. I'm glad you found a workaround.
It would be still nice, if you could provide a test-case. Binary compatibility
between different platforms is important for Kryo. Your test-case could help us
to fix the issue, if it still exists. We could even include a (modified)
version of your test-case into the set of Kryo's unit tests, so that this
problem never occurs again.
Would it be possible for you to provide a test-case?
Thanks,
Leo
Original comment by romixlev
on 23 Jul 2013 at 1:35
There were some recent changes in the trunk based on a similar bug report. It
could be that your problem is solved now.
The issue fixed was related to the fact that different versions of JDK handle
arrays used as generic type parameters differently (e.g. Map<String, int[]>
mymap). It hopefully should work now.
Let us know if it is fixed or not.
Btw, the kryo-2.22-SNAPSHOT is available in the sonatype snapshots repo:
https://oss.sonatype.org/content/repositories/snapshots/
(https://oss.sonatype.org/content/repositories/snapshots/com/esotericsoftware/kr
yo/kryo/)
Original comment by romixlev
on 22 Aug 2013 at 7:56
Did this issue ever get fixed? I am beginning to use kryo for serialization
between a linux and a windows system and want to make sure I don't run into
this issue. Also, is the issue just with arrays used as generic type parameters?
Original comment by zsol...@gmail.com
on 15 Oct 2013 at 10:47
Do you still have problems using the latest Kryo release, i.e. 2.22? If it
still fails, can you provide a reproducible test-case?
Original comment by romixlev
on 15 Oct 2013 at 10:49
Original issue reported on code.google.com by
me...@ntlworld.com
on 11 Mar 2013 at 11:18