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

MDB ejbCreate And createException

 
Rashmi Tambe
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can an ejbCreate() method in MDB throw CreateException? What happens if it does throw? If it's not allowed , then why not? can anybody explain....
 
Yi Si
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not throw CreateException in ebjCreate() methods of MDB , session bean and entity bean.the mothods its name begin with "ejb" invoked by container,container does expect get application exception such as CreateException .But you can throw CreateException in Create() methods of session bean and entity bean home interface, but not MDB.beasause MDB have not client, if you throw one, who will receive it.(MDB have not Home interface and component interface.)
[ March 04, 2004: Message edited by: si yi ]
 
Sudhir V
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Si
CreateExceptions are allowed to be thrown from ejbCreate methods of session and entity beans but not from MDB beans. See EJB Spec Pg 96 7.10.3.
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also spec section 15.7.3 page 324 - you aren't supposed to even declare any application exception on the ejbCreate for an MDB.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic