Solved

InvalidClassException

Posted on 2006-11-10
3
214 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

860 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