aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes ejbCreate method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "ejbCreate method" Watch "ejbCreate method" New topic
Author

ejbCreate method

sawan parihar
Ranch Hand

Joined: Aug 24, 2004
Posts: 250
Hi,
Is ejbCreate method in the entity bean class must specify javax.ejb.CreateException in the throws clause. In the specs page no 192 its written that "the throws clause must specify javax.ejb.CreateException". I tried with weblogic,websphere it works if u don specify it.

Sawan


Sawan<br />SCJP,SCWCD,SCBCD<br /> <br />Every exit is an entry somewhere.
Leena Diwan
Ranch Hand

Joined: Jun 18, 2001
Posts: 351
Did you actually create and entity? Did you try introducing some problem and check? Does your home interface create method throw the CreateException? [the bean directly does not implement the home interface but internally the ejbCreate method gets called when the client goes for create]

Did you try any other type of bean?

ejbCreate methods are not checked by the compiler as it is not in any interfaces that we implement for a bean. So check the runtime behaviour.

Regards,
Leena


[SCJP2, SCWCD1.3, SCBCD]
sawan parihar
Ranch Hand

Joined: Aug 24, 2004
Posts: 250
Hi,
I do understand that the home interface is not implemented by the bean . I tried creating the bean and it works. The create method in the home interface is required to throw the CreateException for both local or remote interfaces but the ejbCreate() in the bean class is not required to specify the CreateException in throws clause. But again on page 192 the spec says that it must throw.

Well it works (both compile time and runtime).

Sawan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejbCreate method