This content has been marked as final.
Show 2 replies
-
1. Re: Manager in JNDI Context from Tomcat
mikewse Jun 4, 2009 5:42 PM (in response to alexanderbell)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
andygibson.contact.andygibson.net Jun 5, 2009 8:05 PM (in response to alexanderbell)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" auth="Container" type="javax.inject.manager.Manager" factory="org.jboss.webbeans.resources.ManagerObjectFactory"/>
and make it available to your deployment by adding this to web.xml:<resource-env-ref> <resource-env-ref-name> app/Manager </resource-env-ref-name> <resource-env-ref-type> javax.inject.manager.Manager </resource-env-ref-type> </resource-env-ref>
Tomcat only allows you to bind entries to java:comp/env, so the Manager will be available at
java:comp/env/app/Manager
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:Cheers,
Andy Gibson