JDK-4065747 : incorerctly get java.io.InvalidClassException: Local class not compatible
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io:serialization
  • Affected Version: 1.1.2
  • Priority: P2
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: solaris_2.5
  • CPU: sparc
  • Submitted: 1997-07-18
  • Updated: 1997-08-14
  • Resolved: 1997-08-14
Related Reports
Relates :  
Description
I have a bean which has a serialized object, when trying to load the bean in
beanbox the object cannot be serialized (if you go past 4065738) because of 
the following:

java.io.InvalidClassException: connect.widgets.ImageListBox; Local class not compatible
        at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java)
        at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
        at java.io.ObjectInputStream.inputObject(ObjectInputStream.java)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
        at java.io.ObjectInputStream.inputArray(ObjectInputStream.java)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
        at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java)
        at java.awt.Container.readObject(Container.java:1161)
.....

However the class in question connect.widgets.ImageListBox DID NOT change
between serialization and deserialization (it was the same class the serialized object was created from) so I dont know why Local class not compatible exception
is thrown.

To reproduce, try loading the attached JAR file into beanbox and instantiate
the loaded bean.

Comments
EVALUATION Recreated failure with submitted JAR file. Investiagation determined that the serializaed stream could be corrupt. The SerialVersionUID of the class connect.widgets.ListImageBox was different than the one in the stream. This is impossible since the class was a third party class and could not have been recompiled. Spoke with submitter on the phone, he could not recreate this failure when I requested the steps for building the JAR that was submitted.
11-06-2004

WORK AROUND
11-06-2004

SUGGESTED FIX
11-06-2004