• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple JNDI names for EJB  RSS feed

 
Martin Lira
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone explain if there can be multiple JNDI names for an EJB that is deployed.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Obviously, if you have an EJB jar that is deployed multiple times, then you will have bound each to a distinct JNDI name. As such, you will resolve the same interface type from different JNDI names. Within one deployed application, I'm not sure why you would have multiple JNDI names mapping to one home interface. I suppose the container could allow you to do this, but I can't imagine why you would need to. Of course, there's the issue to ejb-refs, which are linked in JNDI by the container, so essentially they are multiple JNDI names (with a level of indirection usually) for the same home interface.

In most cases though, you will have one distinct JNDI name per deployment, with any number of ejb-refs.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!