• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple ejbCreate in SLSB and MDB

 
Lu Jin
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
according to the EJB spec, is it considered an error if I put multiple ejbCreateXXX in SLSB and MDB?
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need to pass differing args to a bean, then you need method names which must have ejbCreate as their prefix.

Note that it is forbidden for any business method to be prefixed by "ejb" to avoid conflicts with the callback methods used by the EJB architecture.
 
Greg Charles
Sheriff
Posts: 3002
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the EJB 2.0 spec, in section 7.8 on page 87, states that it is illegal for the bean class of a stateless session bean to define anything but the no argument ejbCreate() method. This is also true for message-driven beans.

Stateful session beans are allowed to define multiple overloaded ejbCreate() methods and methods in the form ejbCreateXXX().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic