Source : Enterprise JavaBeans 3.1 O'Reilly Sixth Edition
Chapter 16: JNDI, the ENC, and Injection
@javax.ejb.EJB (Page:264)
The beanName()is the EJB name of the EJB referenced. It is equal to either the value you specify in the @Stateless.name()or @Stateful.name()annotation or the value you put in the <ejb-name>field in the XML deployment descriptor
Suppose
MyEJB wants a reference to the local business interface of
MyEJB2. Then, as per the above statement(
The beanName()is the EJB name of the EJB referenced)
the beanName should be equal to "
MyEJB2".
However,its also written that its value can be equal to
"value you put in the <ejb-name>field in the XML deployment descriptor".
The value put in the <ejb-name> is the name of the EJB that wants a reference to some other bean.(Here,
MyEJB)
Question 1:How can the 2 statements in
BOLD be true.They seem to be contradictory ?