wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Do we need throw exception in ejbCreate() method?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Do we need throw exception in ejbCreate() method??" Watch "Do we need throw exception in ejbCreate() method??" New topic
Author

Do we need throw exception in ejbCreate() method??

Paul Yen
Greenhorn

Joined: Feb 08, 2004
Posts: 19
When I read HFEJB book, it only throws exception in Home interface but not in the bean class for create() method. I download the example code from the website of HFEJB. In that CustomerBean code, I saw it declares throw CreateException in ejbCreate() method. I just confused about this. Is this needed or not?? Cuz when I deploy it without put that exception in ejbCreate(), it failed. With it, I can deploy it without any problem. Any one has experience on this?
Thanks.


SCJP 1.4, SCWCD, SCBCD,<br />SCDJWS (preparing)
Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1064
Throwing CreateException in the create() methods of the home interface is mandatory for both Session and Entity beans.
Throwing CreateException is also mandatory for the corresponding ejbCreate()methods of the entity beans, but optional for Session beans.
Usually we declare CreateException at both the places for all beans.
There are many people who have read/reviewed Kathy's book in the SCBCD forum. I am sure you would get more answers there for ur specific question.
Paul Yen
Greenhorn

Joined: Feb 08, 2004
Posts: 19
Thanks a lot Vish!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Do we need throw exception in ejbCreate() method??
 
Similar Threads
ejbPostCreate() for session/message beans
Getting EJBObject from ejbCreate() on stateless bean
allowed operation in ejbCreate() of stateless session bean
Exception-Doubt
Exception question for *REAL EJB MEN* (ok, Kathy, for REAL J2EE GIRLS too)