Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Home Interface Create method

 
Chetan Sahasrabudhe
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

The book says that the create method of home interface can be delcared as,

>>public Advice create() throws CreateException, RemoteException;

As I can see EJBHome does not have any create method. Secondly if EJBHome would have got any create() method, then Advice create() is not a right declaration.

As I did not find any of the linking of this create method in any parent interfaces either EJBHome or EJBObject or for that matter in SessionBean or EnterpriseBean, I opted to call my create as invent. so the method signature became,

public Advice invent() throws CreateException, RemoteException.

the compilation goes smooth, even the verification is going great in RI.

But when I try to deploy this on server, it throws a popup error saying RMI and all kind of exceptions.

Why is this happening, I have made sure that my business method i.e. getAdvice is identical in Component interface as well as in Bean class.

Please explain. [Current state of mind: ]
Regards
Chetan
 
Sekhar Kadiyala
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the create() method has relation to ejbCreate() method that you would have included in the bean class. As with the other methods (like business methods), at the compile time, you wouldn't face any issues because bean class doesn't implement home or component interface.

I would suggest you go thru the first 5 chapters (so you will get an idea as to why all these methos (all methods starting with ejb and create methods) are needed. Then you can experiment with them.

Good Luck
 
Vaithiya Sundaram
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is the rule that you should have,
ONE create method in StateLessSessionBean home interface
ONE or MORE create methods in StateFulSesssionBean home interface
ZERO or MORE create methods in Entity Bean home interface.

In EJBHome you will not find create method because the same EJBHome is used for entity bean home interfaces too and Entity Bean home interface no need to have create method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic