• Post Reply Bookmark Topic Watch Topic
  • New Topic

Incompatible Class?  RSS feed

 
Matt DeLacey
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just recently added some code using the java.awt.geom package. When I exported the code and tried to run, I got this error (never seen before):
Exception in doDisplay = java.io.InvalidClassException: PrintLabelDataCode39; Local class not compatible: stream classdesc serialVersionUID=-7055949461334852060 local class serialVersionUID=-4873628894647225212 java.io.InvalidClassException: PrintLabelDataCode39; Local class not compatible: stream classdesc serialVersionUID=-7055949461334852060 local class serialVersionUID=-4873628894647225212 at java.io.ObjectStreamClass.validateLocalClass(Unknown Source) at java.io.ObjectStreamClass.setClass(Unknown Source) at java.io.ObjectInputStream.inputClassDescriptor(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at java.io.ObjectInputStream.inputObject(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at java.io.ObjectInputStream.inputArray(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at java.io.ObjectInputStream.inputClassFields(Unknown Source) at java.io.ObjectInputStream.defaultReadObject(Unknown Source) at java.io.ObjectInputStream.inputObject(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at java.io.ObjectInputStream.inputClassFields(Unknown Source) at java.io.ObjectInputStream.defaultReadObject(Unknown Source) at java.io.ObjectInputStream.inputObject(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at LabelPrinter.getObjectFromUrl(LabelPrinter.java) at LabelPrinter.getLabelMetrics(LabelPrinter.java) at LabelPrinter.doDisplay(LabelPrinter.java) at LabelPrinter.init(LabelPrinter.java) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

I'm pretty far along in the development cycle, and haven't had any problems heretofore, so it's not like I'm just figuring all this stuff out. It SEEMS like the class files used in the java.awt.geom.* are not compatible with the jvm. They are separate. One is the jvm that comes with VisualAge for java. I believe it is 1.2.2 for the version I am using.
It is 1.2.2 on the server too. The only difference is Windows versus Solaris, but I've never had any troubles with that in the past (and shouldn't). Any thoughts?

With respect,
Matt DeLacey
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't give a lot of detail about what your application is doing, but...
What this error means is that one JVM serialized an object, and another one deserialized it, and the versions of the .class files (PrintLabelDataCode39?) are different for the two JVMs. There's a mismatch of the "serialVersionUID," (a long which can either be computed by the serialization machinery or given explicitly as a static data member in your class.)
The whole serialVersionUID thing can be tricky. Here is a brief but possibly useful article to get you started.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!