If you are running JBoss 4/5 having a dump of the JNDI tree is quite easy. Open your JMX console:
http://localhost:8080/jmx-console
and look for the Service “JNDIView” (it’s under the object name jboss)
Now simply find the method “list”, click it
without writing a line of code but simply using the JMX Console
If you are running WildFly application server, you need to use any of the management instruments (such as the CLI or the Web Console).
For example, from the CLI you can run:
/subsystem=naming:jndi-view
On the other hand, if running the Web Console you can check the following path:
Runtime
-> Standalone server
-> Subsystems
-> JNDI View
-> View