This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ENC

 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Why do one has to register itself in ENC in order to access other EJBs. I mean when you deploy an EJB, does'nt it get automatically registered in the JNDI. I mean when I deploy Stateless Session Bean, It gets registered with the JNDI. So we could access it through JNDI. Then Why do we have to register in ENC for using EJB in other EJBs?

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

Every EJB has it own Entreprise Naming Context.
It's a registry JNDI but it's not the global JNDI registry of the application server.

If you want an EJB A to use an EJB B, you've got to reference B in the JNDI ENC of A.
This can be done either with annotation (@javax.ejb.EJB) or XML-DD (<ejb-ref> .

Hope it helps,

Beno�t
 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, But could'nt I refer to other EJBs throught global JNDI. When we deploy an EJB, it gets registered in the global JNDI. Right?
 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any difference in JNDI & EJB's ENC?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic