Pages

Monday, July 19, 2010

JBoss JNDI [ Short Notes ]

Share it Please

There are many times in our applications that we need to access objects in Jndi.
Data sources, ejb objects and many objects are placed in Jndi which can be accessed by the application.

In this article we will have a short look on the JBoss Jndi, 

In order to view all the objects available in the Jndi, go to




·                  In the jmx-console , search for “service-JNDIView” , and click it.
·                  Now we are in JMX Mbean view , go for the “list” operation .
·                  Click invoke
·                  Now you we are taken to the  “JMX MBean Operation View


There we can see

Global JNDI Namespace and Java: Namespace
 
We have 2 names spaces here

Global JNDI Namespace: objects bound in global jndi can be accessed by client application that starts in different JVM.

The object bound in the global jndi can be accessed as

Context=new InitialContext();
lookup(“object Name”);

Java: Namespace: objects bound in the java name space can be access by the client applications that start in the same JVM.

The object bound in the java:namespace can be accessed by

Context=new InitialContext();
lookup(“java:/object Name”);

consider 





In this situation , nesting of the names happened here .this tells us that the object of the type org.jboss.security.plugins.SecurityDomainContext is bound by the name jmx-console under the path jaas . this object can be accessed as

Context=new InitialContext();
lookup(“jaas/jmx-console”); // global name space
lookup(“java:jaas/jmx-console”); // java name space

more articles still to come , So Happy coding…..

 

No comments :

Post a Comment