Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1994

WebSocket endpoint injection on Tomcat

    XMLWordPrintable

Details

    Description

      Everything works fine in glassfish and Wildfly.
      In tomcat bean injection works fine in servlet, and ServletContextListener.
      But in WebSocket endpoint, no way.

      • I add of course a maven dependency of weld
        <dependency>
        <groupId>org.jboss.weld.servlet</groupId>
        <artifactId>weld-servlet-core</artifactId>
        <version>3.0.0.Alpha11</version>
        </dependency>
      • In context.xml I add the resource BeanManager
        <Resource auth="Container" factory="org.jboss.weld.resources.ManagerObjectFactory" name="BeanManager" type="javax.enterprise.inject.spi.BeanManager"/>
      • And in web.xml, I add the listener and resource-ref
        <listener>
        <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
        </listener>
        <resource-env-ref>
        <resource-env-ref-name>BeanManager</resource-env-ref-name>
        <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
        </resource-env-ref>

      Attachments

        Activity

          People

            Unassigned Unassigned
            hhfrancois_jira Francois Francois (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: