Hi,
My actuall situation is to convoluted to describe fully, but basically
my servlet serializes and my application, which I run out of Eclipse,
deserializes and I get
mypackage.MyClass$1; local class incompatible: stream classdesc
serialVersionUID = -6759369633728135399, local class serialVersionUID
= 8248309381925280497
This does not happen when I compile and run the classes outside of
Eclipse.
Any ideas on how fix this?
Manish Pandit - 18 Jun 2007 07:37 GMT
On Jun 17, 10:55 pm, aaronf...@gmail.com wrote:
> Hi,
>
[quoted text clipped - 10 lines]
>
> Any ideas on how fix this?
You can override the serialVersionUID in your data object that you're
serializing.
Something like :
private static final long serialVersionUID = 1L;
However, you will have to change this ID or figure out compatiblity
(via externalization instead of serialization?) whenever you add/
remove state variables.
Personally, I prefer externalization over serialization due to that
fact that I have larger control (write to XML/CSV/compress/encrypt..)
and I can handle versions of data objects in a clear fashion.
-cheers,
Manish