I have looked around for information on this, but it's been strangely impossible to find.
I want to know this: does one have to do anything specific for @Local/@Stateless beans to show up in JNDI? I had thought that this was more or less automatic. But listing the InitialContext turns upp nothing, really nothing.
I am using this code to dump JNDI info:
System.out.println("========== jndi ============");
InitialContext initialContext;
try {
initialContext = new InitialContext();
//Get all the names in the initial context
NamingEnumeration children = initialContext.list("");
while(children.hasMore()) {
NameClassPair ncPair = (NameClassPair)children.next();
System.out.print(ncPair.getName() + " (type ");
System.out.println(ncPair.getClassName() + ")");
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("========== jndi. ============");
This code is run in a servlet handler. I am doing this on a Tomcat 7.