Goal is to list all the JNDI entries programmatically. new InitialContext().list("java:global")
doesn't work.
EJB 3.1, Wildfly or Glassfish 4
I think that the safer way to navigate in JNDI namespace is first to lookup its root and then list its content.
I've tried this way in WildFly 8.1.0 and it worked :
Context root = (Context) new InitialContext().lookup("java:global");
NamingEnumeration<NameClassPair> names = root.list("");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With