• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about ejb-name in DD

 
Michael Maier
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

it is possible to name a bean in Deployment Descriptor in the way



or is only an 'unqualified' name like



allowed? I ask because the annotation @Stateless(name="ejb/funnyBean") seems to be ok but the above entry in Deployment Descriptor results in an error (jboss 4.2). According to the specification the element name of @Stateless is equivalent to <ejb-name> .

Thanks for your help,

Michael
 
Benoît de Chateauvieux
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael,

Note that the name attribute of the @Stateless annotation isn't the JNDI name but the ejb-name.
Generally, the ejb-name is 'unqualified'.

From EJB3 specs (19.2):
Enterprise bean�s name.
A logical name is assigned to each enterprise bean in the ejb-jar file.
There is no architected relationship between this name and the JNDI name that the Deployer will assign to the enterprise bean. The Bean Provider can specify the enterprise bean�s name in the ejb-name element. If the enterprise bean�s name is not explicitly specified in metadata annotations or in the deployment descriptor, it defaults to the unqualified name of the bean class.


The deployer binds the EJB to a JNDI registry with a container's tool.

Beno�t
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic