wood burning stoves 2.0
The moose likes JBoss/WildFly and the fly likes JNDI in JBOSS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JNDI in JBOSS" Watch "JNDI in JBOSS" New topic


Walker Rustin
Ranch Hand

Joined: Mar 08, 2004
Posts: 37
I have gone through the material at JBoss and still not sure how JNDI works in JBOSS. Here is an example of jboss.xml. The code works but I am not sure where I am mapping java:comp/env/ejb/user to the user ejb.
<?xml version='1.0' encoding='UTF-8' ?>
- walk rustin

Asad Zaman

Joined: Feb 16, 2003
Posts: 6
Hi rustin,
You can easily find out the mapping if you look at the ejb-jar.xml.
As you've declared <ejb-local-ref> as follows:
This means that you are declaring a name "user" in the JNDI ENC
tree java:comp
+- env
| +- jdbc
| | +- BankDB [link -> java:/DefaultDS]
| +- ejb
| | +- user
The BankDB name under jdbc is the JDBC name you have declated
in your ejb-jar.xml
You can look out the JNDI ENC tree of all names your JBossAS
has prepared for you.
1. Run your JBossAS
2. Open your browser and type http://localhost:8080/jmx-console
in the address bar and press enter. you should see JMX Agent View
of JBossAS. This is the MBean page of JBoss.
3. In the jboss section you should see a link service=JNDIView.
Click this link. You should now see JNDIView Service MBean view.
Scroll down the page until you can see a operation name named "list".
Press the invoke button of list operation.
You should be navagated to the result page of the list operation.
4. Find out a section named Ejb Module: xxx.jar section.
(here xxx.jar is the name of file name of your EJB).
And see what JNDI tree is constructed from your EJB by JBossAS.
Play with the jmx-console for sometime. I am sure you will
be cleared all of your Questions.
Asad Zaman
I agree. Here's the link: http://aspose.com/file-tools
subject: JNDI in JBOSS
It's not a secret anymore!