This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "  " Watch "  " New topic

Atul Prabhu
Ranch Hand

Joined: Dec 17, 2002
Posts: 60

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

Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
You can't set CMR fields in ejbCreate--do that in ejbPostCreate.

Atul Prabhu
Ranch Hand

Joined: Dec 17, 2002
Posts: 60

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 .....?

It is sorta covered in the JavaRanch Style Guide.
Similar Threads
Deployment errors in JBoss5.1
Test Client For FBN
SerialUID error
QName; local class incompatible
Storing serialized objects