> From: Dola Woolfe [mailto:[EMAIL PROTECTED] 
> Subject: Re: InvalidClassException between Tomcat and Eclipse
> 
> Can you explain the idea behind serialVersionUID

AFAIK, its primary purpose is to insure that the deserialized object is
compatible with the the current class definition.  Serializable classes
distributed with the JRE have explicit serialVersionUID values, and are
changed whenever the class implementation changes - not just when
methods or fields are updated.  It's usually not safe to depend on the
automatically generated ID value, since logic changes could produce
incompatibilities; best to always set your own and be careful to
increment it whenever modifying the class (I think some of the IDEs will
do this for you).

Look here, especially section 4.6:
http://java.sun.com/javase/6/docs/platform/serialization/spec/class.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to