• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

java.io.InvalidClassException

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to implement 1:N relationship.

Ex: Plane -- Seats
Seat Bean would be having a plane id as the foriegn key.
The client code is as below :


Ejb create of Seat Bean is as follows :


Exception occurs when the method setPlane () is invoked.
java.io.InvalidClassException: javax.ejb.EJBException; local class incompatible: stream classdesc serialVersionUID = -9219910240172116449, local class serialVersionUID = 796770993296843510

Could any one suggest why does the exception occur..

However the same code works if I invoke setPlane() from the client.i.e.


Thanks for the help in advance.

Regards
Atul
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't set CMR fields in ejbCreate--do that in ejbPostCreate.
 
Atul Prabhu
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I tried calling setPlane method from ejbPostCreate but it gives an exception that all the primary key fields should be set in the ejbCreate.
My Seat Bean has two primary key fields one is the seatno and another one is the plane id.

But what is the difference if i call setPlane() method from ejbCreate or ejbPostCreate.

I know that this problem would be solved if i pass planeid to ejbCreate rather than the remote object of PlaneBean.

Can't I pass remote object's to ejbCreate method or any other method .....?

Regards
Atul
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic