Solved

InvalidClassException

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how do i compare an object based on two fields 6 54
Arrays.asList  VS  ArrayList 4 60
map related example 6 48
web application structure 18 77
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

809 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