This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

multiple ejbCreate in SLSB and MDB  RSS feed

 
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: 3015
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().
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!