File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejbCreate method

 
sawan parihar
Ranch Hand
Posts: 250
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Leena Diwan
Ranch Hand
Posts: 351
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
sawan parihar
Ranch Hand
Posts: 250
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic