Re: Forgot to assign serialVersionUID and class changed.





> Hello,
>
> I forgot to assign serialVersionUID to my serializable class. A new
> field got added to the class in the newer version. I don't have access
> to the old .class now to generate the serialVersionUID from it and
> assign it to the newer version.

If you know which field got added you can remove the field, compile the
class, get its serialVersionUID, add the field back and assign the
serialVersionUID.

>
> Anyone knows if its still possible to instantiate the old serialized
> class from its persisted version?

Surely you know that the serialized data does not include class
definition.

>
> Tks & Rgds
> Gap

.



Relevant Pages