users@glassfish.java.net

Re: Mismatched serialization UIDs

From: <glassfish_at_javadesktop.org>
Date: Fri, 04 Apr 2008 12:51:26 PST

TopLink either modifies entity classes ("weaves" them) on load or substitutes collection access at runtime to be able to detect lazily accessed or modified relationships (there is no way to support lazy load without this or subclassing or using a proxy at runtime). Which brings us to a very important point: you shouldn't use reflection to access an entity, but only via its business methods.

When a weaved entity is serialized on the server and deserialized on the client that doesn't have its corresponding entity weaved, the serialVersionUIDs won't match as the calculation of the value includes class fields and methods. See e.g. http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/class.html for details.

Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

http://forums.java.net/jive/thread.jspa?messageID=267810