The exception you're getting is telling you, at least partly, what the
problem is:

java.io.InvalidClassException:
  javax.ejb.EJBException; Local class not compatible: stream classdesc
    serialVersionUID=2303241739226627938 local class
serialVersionUID=-9219910240172116449
  java.io.InvalidClassException:javax.ejb.EJBException; Local class not
compatible:
    stream classdesc serialVersionUID=2303241739226627938 local class
serialVersionUID=-19910240172116449

In other words, the object, when it was serialized, was serialized using a
class whose serialVersionUID was 230.... and the class on the receiving end
had a serialVersionUID of -921.... and so forth.

In layman's terms, this means that you have a class somewhere on your
CLASSPATH in the client that doesn't match up with the class in the
CLASSPATH of the server. If you're like most Java developers, you have a
twelve-page CLASSPATH environment variable, which then forces you to go on
an agressive .class-file hunt to find all the different copies of the class
in question and eliminate all but one. :(

Unfortunately, that's all I can really tell you. The actual low-level reason
for the exception can be found by reading more about Serialization; either
check out Stu Halloway's Tech Tips (from the JDC) on Serialization, or else
read the Java Serialization Spec (in the JDK doc bundle).
<marketing-plug>You can also read the chapter I wrote on Serialization in
"Server-Based Java Programming"</marketing-plug>, but that's not necessarily
the best place to get the full details on Serialization--go to Stu's tips or
the Spec first.

Hope this helps some.

Ted Neward
{.NET||Java} Instructor, DevelopMentor  (http://www.develop.com)
http://www.javageeks.com/~tneward/index.html

> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Sachin Devand
> Sent: Saturday, March 31, 2001 11:01 PM
> To: [EMAIL PROTECTED]
> Subject: [EJB-INT] Class Cast Exception Once Again !!
>
>
> Hi,
>
> This issue has come up earlier in this mailing list. I
> looked at it but still my problem is unsolved. Do let
> me know if someone can answer this question. I am
> trying to do a PortableRemoteObject.narrow() on a bean
> that I lookup from jndiContext. The problem is that I
> get a class cast exception. I have tried to add the
> generated jar files from weblogic.ejbc in the
> CLASSPATH, but still I get this error. If anyone knows
> a way out I would deeply appreciate it.
>
> Thanks.
> Devand
> ----------------STDERR-------------
> java.rmi.UnmarshalException: Problem deserializing
> error response; nested except
> ion is:
>         java.io.InvalidClassException:
> javax.ejb.EJBException; Local class not c
> ompatible: stream classdesc
> serialVersionUID=2303241739226627938 local class ser
> ialVersionUID=-9219910240172116449
> java.io.InvalidClassException:javax.ejb.EJBException;
> Local class not compatible: stream classdesc
> serialVersionUID=2303241739226627938 local class
> serialVersi
> onUID=-9219910240172116449
>         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).....
> -----------------STDERR---------------
> My Application is Simple:
> Context jndiContext = getInitialContext();
> Object obj = (CabinHome)jndiContext.lookup
> ("CabinHome");
> CabinHome home =
> (CabinHome)PortableRemoteObject.narrow
>                     (obj,CabinHome.class);
> Cabin cabin1 = home.create(1);
> .....
> ----------------------------------
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/?.refer=text
>
> ==================================================================
> =========
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to