Serialization of an Object of a class on 2 different JVMs in java - Stack Overflow
if you have serialVersionUID in your class, serialize/deserialize will not be a problem, but if serialVersionUID is missing in your code, as you are compiling class with both JVM(I understand, .class file has same content but compiled with different JVMs) in that case, serialVersionUID is assigned by java, which won't be same, hence serialize/deserialize will not work. So, add
private static final long serialVersionUID = -6903933977591709194L;
in case you haven't added, with any value, and compile as many times, rest assured, serialize/deserialize will work. :)
Read full article from Serialization of an Object of a class on 2 different JVMs in java - Stack Overflow
No comments:
Post a Comment