I think a safer way to navigate in the JNDI namespace is to first root it and then list its contents.
I tried this way in WildFly 8.1.0 and it worked:
Context root = (Context) new InitialContext().lookup("java:global"); NamingEnumeration<NameClassPair> names = root.list("");
source share