Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / August 2005

Tip: Looking for answers? Try searching our database.

Forgot to assign serialVersionUID and class changed.

Thread view: 
gappodi@hotmail.com - 12 Aug 2005 04:53 GMT
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.

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

Tks & Rgds
Gap
Hemal  Pandya - 12 Aug 2005 09:46 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.