Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error deserializing object/Local class not compatible

8 views
Skip to first unread message

rerez

unread,
Apr 1, 2001, 6:36:15 AM4/1/01
to
Hi,
I have a class hierarchy that implement an Accept() method (the Visitor
pattern).
I send this class instance as object in en ObjectMessage.
but when I remove the implementation of the Accept from the low level
classes (the ones in the bottom of the hierarchy tree) I get this error
message?
can any one help me?

weblogic.jms.common.JMSException: Error deserializing object
at
weblogic.jms.common.JMSUtilities.jmsExceptionThrowable(JMSUtilities.j
ava:66)
at
weblogic.jms.common.JMSUtilities.jmsException(JMSUtilities.java:52)
at
weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.jav
a:113)
at
examples.ejb20.objectmessage.MessageTraderBean.onMessage(MessageTrade
rBean.java:134)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:221)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
----------- Linked Exception -----------
java.io.InvalidClassException: examples.ejb20.objectmessage.WispUserMessage;
Loc
al class not compatible: stream classdesc
serialVersionUID=7287981833761935167 l
ocal class serialVersionUID=-6094443040413043472
at
java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:5
23)
at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:567)
at
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java
:936)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
at
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java
:940)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
at
java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
at
weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.jav
a:111)
at
examples.ejb20.objectmessage.MessageTraderBean.onMessage(MessageTrade
rBean.java:134)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:221)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

Thanks Ronen Erez


Steve Felts

unread,
Apr 1, 2001, 9:12:48 PM4/1/01
to
Usually, it a class not found indicates a problem with your CLASSPATH.
Is the class in the CLASSPATH of your WL server?

I can't quite tell if you are running 6.0 or 6.0 Service pack 1.
The following was fixed in service pack 1 - it's not quite your problem
but it might be related ...

CR042484
JMS ObjectMessage cannot properly serialize EJB helper classes.

When trying to create an ObjectMessage within a bean, the JMS throws a ClassNotFoundException. The reason for this is
due to the new Classloader structure in WLS. If an EJB tries to create an ObjectMessage using an object packaged within
the EJB, not in the CLASSPATH, then the exception is thrown as follows.
weblogic.jms.common.JMSException: setObject: problem serializing copy
at weblogic.jms.common.ObjectMessageImpl.setObject(ObjectMessageImpl.jav


"rerez" <ro...@trivnet.com> wrote in message news:3ac7...@newsgroups.bea.com...

rerez

unread,
Apr 2, 2001, 4:43:41 AM4/2/01
to
Hi,
The problem is that I sent an object that inherits from another object and
when I am trying to use a method that is defined in the perent class I get
this error.
I added it to the CLASSPATH but it didnt work.
any sugestions?
Thanks Ronen Erez

"Steve Felts" <St...@spam.com> wrote in message

Tom Barnes

unread,
Apr 2, 2001, 12:11:58 PM4/2/01
to rerez
The error message:

> > Local class not compatible: stream classdesc


> > serialVersionUID=7287981833761935167 l
> > ocal class serialVersionUID=-6094443040413043472

Seems to indicate an object serialization versioning problem.
You may have one version of the class on the source and another
on the destination. Just adding a method can change the serialVersionUID. If
this
is the problem, you may want to hard code the serial version
uid in the class: "static final long serialVersionUID = 7287981833761935167 l".
see ObjectInputStream.resolveClass and the jdk's "serialver" command for
more info, I don't know where else this is documented in the jdk.

rerez

unread,
Apr 2, 2001, 12:16:10 PM4/2/01
to
Hi,
Thanks for the answer.
I looked into it a little further and found out the Visitor patter I used
dose implicit casting to the object and casting is not a compatible
operation on a serialized object.
Thanks Ronen Erez

"Tom Barnes" <dev....@not.my.address.com> wrote in message
news:3AC8A4CE...@not.my.address.com...

0 new messages