That's what I have done at the moment. The exception trace showed the class version id that it expected the target class on machine B. I put that as the serialVersionUID in the class on machine B and it works fine. But I don't understand why it should throw an exception if not declared as the class hasn't changed and I am using the same jdk on both the machines.
 
Cheers
Sachin Pandey
NUIX Pty Ltd
Level 8, 143 York Street,
Sydney 2000
Phone: (02) 92839010
Fax: (02) 92839020
 
Disclaimer:
This message is intended only for the named recipient. If you are not the intended recipient you are notified that disclosing,copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
----- Original Message -----
Sent: Monday, September 30, 2002 5:51 PM
Subject: Re: Local class not compatible

Hi,

         You should declare the serialVersionUID instance variable for your class. Otherwise the id will be generated by java which will be different for different jdk build. If you use same jdk build in both the machines then this problem may not come. Try with serailVersionUID. I hope this will solve your problem.

Regards
V.S.Saravanan


Sachin Pandey wrote:
I am storing a serialized version of a class in the database.I ran the upload on a machine A, backed up the database and restored the database on another machine B. On machine B when I try to retrieve the object back I am getting a SQLException saying that the local class is not compatible showing two different serialVersionUID's.There is no difference in the class source between machine A and machine B. I haven't declared the private serialVersionUID instance variable for the class (which I should). What's confusing me is if the class hasn't changed then why am I getting this "Local class not compatible" exceptions. I am retrieving the object from an Entity Bean the sql type is set as OID and the jdbc type as a JAVA_OBJECT. In what cases can I get this exception apart from the class source changing? 
 
Cheers
Sachin Pandey
NUIX Pty Ltd
Level 8, 143 York Street,
Sydney 2000
Phone: (02) 92839010
Fax: (02) 92839020
 
Disclaimer:
This message is intended only for the named recipient. If you are not the intended recipient you are notified that disclosing,copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

=========================================================================== 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