0

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.

Jonas N
  • 1,757
  • 2
  • 21
  • 41
  • Of course: http://stackoverflow.com/questions/4304757/how-to-deploy-ejb-3-or-web-application-on-tomcat. Tomcat is not an application server. D'oh. – Jonas N Jan 09 '13 at 10:37
  • But there is something called TomEE: http://tomee.apache.org/apache-tomee.html – Jonas N Jan 13 '13 at 14:29

0 Answers0