Solved

InvalidClassException

Posted on 2006-11-10
3
207 Views
Last Modified: 2008-01-16
[11/10/06 20:04:32:165 CST]   23ed31 SessionContex E Exception is:
java.io.InvalidClassException:
com.hi.pc.ects.business.security.user.Administrator; Local class not
compatible: stream classdesc serialVersionUID=3407418462113710692 local class serialVersionUID=5638901064959335845
        at
java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:518)
        at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:562)
        at


When this came? what to do solve this?


0
Comment
Question by:Manish
3 Comments
 
LVL 23

Accepted Solution

by:
Ajay-Singh earned 25 total points
ID: 17919913
it happens when the classes are different when its serialized and deserialized.
You can add the following to resolve this:

private static final serialVersionUID = 5638901064959335845L; // define this, so that serilaizer wouldn't create a new one.
0
 
LVL 12

Assisted Solution

by:enachemc
enachemc earned 25 total points
ID: 17920549
You have two classes: you want to serialize a instance of a class and deserialize it into an instance of another class (this is what the JRE tells you). You probably think the classes are the same, but the JRE thinks not. This might happen if you did some modification to the class. If they are realy the same class, you should add the private static final serialVersionUID = 5638901064959335845L; definition (the number does not matter, as long as it is the same in the two classes).
0
 
LVL 5

Expert Comment

by:kannan_ekanath
ID: 17929472
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now