2 Replies Latest reply on Jun 5, 2009 8:05 PM by Andy Gibson

    Manager in JNDI Context from Tomcat

    Alexander Bell Newbie


      I'm running on Tomcat 6.
      If I try to get the javax.inject.manager.Manager from JNDI Context I get a NameNotFoundException. I tried the following JNDI names: java:app/Manager and java:comp/Manager.
      Obviously it works with JBoss with JNDI name java:comp/Manager (http://seamframework.org/Community/HowToLookupTheDeployedManagerInAServlet) but that doesn't work within Tomcat.

      Is there a way to get the Manager via a programmatic call in a Tomcat environment.
      I browsed the JNDI Context but I didn't find a Manager reference in it.


        • 1. Re: Manager in JNDI Context from Tomcat
          Mike Wilson Newbie

          Personally I use:

          Manager manager = CurrentManager.rootManager();

          which hard-wires your code to the JBoss RI, but lets you execute it in any servlet container...

          • 2. Re: Manager in JNDI Context from Tomcat
            Andy Gibson Novice

            Did you check out section 16.3.1 - Tomcat in the manual, specifically :

            Tomcat has a read-only JNDI, so Web Beans can't automatically bind the Manager. To bind the
            Manager into JNDI, you should add the following to your META-INF/context.xml:

            <Resource name="app/Manager"

            and make it available to your deployment by adding this to web.xml:


            Tomcat only allows you to bind entries to java:comp/env, so the Manager will be available at

            Web Beans also supports Servlet injection in Tomcat. To enable this, place the webbeanstomcat-support.jar in $TOMCAT_HOME/lib, and add the following to your META-INF/context.xml:


            Andy Gibson