2 Replies Latest reply on Sep 20, 2013 4:33 AM by tomdush

    How to setup Weld Listener (in Jetty) to reuse existing Bean Manager?

    tomdush

      Hello,

       

      I'm writing a standalone Java application which use Jetty to start web application.

       

      In web.xml, I have :

      <listener>
        <listener-class>org.jboss.weld.environment.servlet.BeanManagerResourceBindingListener</listener-class>
      </listener>
      <listener>
        <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
      </listener>
      
      

       

      But, the second listener (org.jboss.weld.environment.servlet.Listener) don't use Bean Manager which is created in main method. It create a second Bean Manager !

       

      Thus, my beans "ApplicationScopped" are instantiate twice...

       

       

      Do you have any suggestion to have only one application context ?

       

      Thanks,

      TD