• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Incompatible Class?

 
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic