Meaningless Drivel is fun!*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Unable to understand difference between  JNDI namespaces i.e java:global, java:module, and java:app. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Unable to understand difference between  JNDI namespaces i.e java:global, java:module, and java:app." Watch "Unable to understand difference between  JNDI namespaces i.e java:global, java:module, and java:app." New topic
Author

Unable to understand difference between JNDI namespaces i.e java:global, java:module, and java:app.

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

Source: EJB 3.1 Specification

4.4 Global JNDI Access

The Java EE Platform Specification defines a standardized global JNDI namespace and a series of
related namespaces that map to the various scopes of a Java EE application.
These namespaces can be used by applications to portably retrieve references to components and resources.


Each portable session bean global JNDI name has the following syntax :

java:global[/<app-name>]/<module-name>/<bean-name>[!<fully-qualified-interface-name>]

java:app

The java:app prefix allows a component executing within a Java EE application to access an appli-
cation-specific namespace

java:module

The java:module prefix allows a component executing within a Java EE application to access a mod-
ule-specific namespace



So,java:global namespace is for external applications for accessing Java EE Beans.
I have a couple of queries on "Global JNDI Access"

Q1. If java:global fulfills the purpose,then why are the other two i.e java:app and java:module required ?
Q2. What does the text "access an application-specific namespace and a module-specific namespace " means for java:module and java:app namespaces ?

OCPJP 6.0 93%
OCPJWCD 5.0 98%
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1624
    
  23

Q1. If java:global fulfills the purpose,then why are the other two i.e java:app and java:module required ?
Q2. What does the text "access an application-specific namespace and a module-specific namespace " means for java:module and java:app namespaces ?


1) You can use whatever you like, however global jndi lookups might have more overhead (if you can just use a lookup inside the same module (i.e. jar) then just use java:module)
2) Have a look at the picture in my notes on chapter 7.4. This will give you a number of examples of what to use when.

Regards,
Frits
Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

Thanks for the reply.I will go through your notes for help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to understand difference between JNDI namespaces i.e java:global, java:module, and java:app.
 
Similar Threads
EJB 3 Local Lookup not working with Weblogic 10.3 and JDK 1.6_05
Numerous questions on JNDI
EJB, JNDI & ENC - real life scenario
Problem with EJB lookup on JBoss 7.1
java:comp/env issue in JBOSS