?
Solved

InvalidClassException

Posted on 2006-11-10
3
Medium Priority
?
227 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Accepted Solution

by:
Ajay-Singh earned 100 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 100 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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses
Course of the Month10 days, 5 hours left to enroll

762 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