[
https://issues.apache.org/jira/browse/TOMEE-947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13667387#comment-13667387
]
Romain Manni-Bucau commented on TOMEE-947:
------------------------------------------
Several things:
1) your inbound impl is not static (-> cdi can't handle it at all)
2) you do a new of the class (why cdi should work?)
3) try to inject your inbound in your servlet and return the instance
Finally websocket threading is not yet handle regading CDI (spec guys are
working on it) so excepted @Dependent and @ApplicationScoped other standard
scopes (request and session) are to avoid
Finally for me there is no issue (or i didnt see it with your sample)
> Injection doesn't work in WebSocket inbound threads
> ---------------------------------------------------
>
> Key: TOMEE-947
> URL: https://issues.apache.org/jira/browse/TOMEE-947
> Project: TomEE
> Issue Type: Bug
> Affects Versions: 1.6.0
> Environment: Oracle JDK 1.7.0.21, Linux i586,
> apache-tomee-1.6.0-20130525.041140-81-jaxrs
> Reporter: Dimitri
> Attachments: WebSocket-CDI-Test.war, WebSocket-CDI-Test.zip
>
>
> When using Tomcat's WebSocket implementation (that means, extending
> org.apache.catalina.websocket.WebSocketServlet), it is not possible to use
> injection, both CDI and non-CDI, from inbound processing threads. Injecting
> scoped and non-scoped objects simply gives null.
> Furthermore, when trying to access a session-scoped instance (OWB proxy) that
> has already been injected into some other object, the following is written to
> the log:
> May 26, 2013 7:57:49 PM org.apache.openejb.cdi.CdiAppContextsService
> lazyStartSessionContext
> WARNING: Could NOT lazily initialize session context because of null
> RequestContext
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira