| Author |
ENC
|
Nikhil Jain
Ranch Hand
Joined: May 15, 2005
Posts: 383
|
|
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
|
SCJP 1.4, SCWCD 1.4, SCBCD 1.5
|
 |
Benoît de Chateauvieux
Ranch Hand
Joined: Aug 10, 2007
Posts: 183
|
|
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
|
SCJP5 | SCBCD5 | SCEA5 Part 1
|
 |
Nikhil Jain
Ranch Hand
Joined: May 15, 2005
Posts: 383
|
|
|
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
Joined: May 15, 2005
Posts: 383
|
|
|
Is there any difference in JNDI & EJB's ENC?
|
 |
 |
|
|
subject: ENC
|
|
|