Listing all names in JNDI in EJB



Based on here and here created a program that lists all Bindings (using context.Bindings) and JDNI names from the context.list:


System.out.println(“Listing all names”);
NamingEnumeration namingenumeration = context.listBindings(“”);
while (namingenumeration.hasMore()) {
Binding binding = (Binding);
System.out.println(binding.getName() + ” XXX ” + binding.getObject()

The core part is the NameClassPair

Result on Client

INFO: JBoss Remoting version 5.0.16.Final-redhat-00001
EjbRemote XXX
javax.naming.Context: true:EjbRemote

This is the binding name for JBoss EAP 7.1: org.wildfly.naming.client.WildFlyInitialContextFactory

javax.naming.Context: true:EjbSum

This is the EjbSum from the EJB pt1 – post.

Result on Server side

03:01:46,984 INFO [org.wildfly.naming] (default task-1) WildFly Naming version 1.0.11.Final-redhat-00001


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s