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 / General / June 2007

Tip: Looking for answers? Try searching our database.

Trouble with InvalidClassException when running application in Eclipse.

Thread view: 
aaronfude@gmail.com - 18 Jun 2007 06:55 GMT
Hi,

My actuall situation is to convoluted to describe fully, but basically
my servlet serializes and my application, which I run out of Eclipse,
deserializes and I get

mypackage.MyClass$1; local class incompatible: stream classdesc
serialVersionUID = -6759369633728135399, local class serialVersionUID
= 8248309381925280497

This does not happen when I compile and run the classes outside of
Eclipse.

Any ideas on how fix this?
Manish Pandit - 18 Jun 2007 07:37 GMT
On Jun 17, 10:55 pm, aaronf...@gmail.com wrote:
> Hi,
>
[quoted text clipped - 10 lines]
>
> Any ideas on how fix this?

You can override the serialVersionUID in your data object that you're
serializing.

Something like :

private static final long serialVersionUID = 1L;

However, you will have to change this ID or figure out compatiblity
(via externalization instead of serialization?) whenever you add/
remove state variables.

Personally, I prefer externalization over serialization due to that
fact that I have larger control (write to XML/CSV/compress/encrypt..)
and I can handle versions of data objects in a clear fashion.

-cheers,
Manish


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.