File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes ENC Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Reply Bookmark "ENC" Watch "ENC" New topic
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ENC
 
Similar Threads
JNDI Lookup/ejb-jar.xml to find an another ejb
Do JNDI Lookups Remove Portability?
EJB, JNDI & ENC - real life scenario
EJB: Is it possible to run a client without using 'runclient', using Sun's RI?
Few EJB questions [newbie]