Upgrading to 1.6 - problems with deserialization
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   David_Matthews
Posted On:   Tuesday, December 12, 2006 11:16 AM

My program saves some of its data by serialization; existing data, created on 1.5, cannot be loaded if the program is run on 1.6, even if it is recompiled first.



The message at the top of a stacktrace is

			
java.io.InvalidClassException: javax.swing.JComponent; local class incompatible: stream classdesc serialVersionUID = 7917968344860800289, local class serialVersionUID = -2514362798440941654


Is there a work around, without recreating the data?

Re: Upgrading to 1.6 - problems with deserialization

Posted By:   Robert_Lybarger  
Posted On:   Tuesday, December 12, 2006 08:56 PM

I haven't run 1.6 yet (my work place will be locked on 1.5 for several more months) ... but the Swing API docs all have serialization warnings. You might have to recreate and re-serialize for 1.6. The warning in the docs:



Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. ...

About | Sitemap | Contact