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

WebSocket endpoint injection on Tomcat

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • Unscheduled
    • 3.0.0.Alpha11
    • Windows 8.1
      Tomcat 7.0.63 and Tomcat 8.0.15
      Weld 3.0.0.Alpha11
      Netbeans 8.02
      Maven

      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>

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

                Created:
                Updated: