Skip to content

Instantly share code, notes, and snippets.

@jfuerth
Created November 29, 2011 17:16
Show Gist options
  • Save jfuerth/1405580 to your computer and use it in GitHub Desktop.
Save jfuerth/1405580 to your computer and use it in GitHub Desktop.
Get weld bootstrapped in Tomcat (save under META-INF/context.xml)
<!--
This context.xml causes Tomcat to insert Weld's CDI BeanManager into
the JNDI context at java:/comp/env/BeanManager. This is required in
Tomcat because Weld's normal boostrap doesn't work: the JNDI context
is read-only to the webapp.
For details, see http://docs.jboss.org/weld/reference/1.0.0/en-US/html/environments.html
-->
<Context>
<Resource name="BeanManager"
auth="Container"
type="javax.enterprise.inject.spi.BeanManager"
factory="org.jboss.weld.resources.ManagerObjectFactory"/>
</Context>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment