Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-370

Expand @RequestScoped and @SessionScoped to account for WebSocket

    Details

    • Type: Feature Request
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      We've been testing injection into a WebSocket endpoint.

      @ReqestScoped objects are usable within the @OnOpen callback. This is because this object is executed within a valid request scope.

      However if you try to use the injected object from within the @OnMessage callback you get a Weld error:
      SEVERE: org.jboss.weld.context.ContextNotActiveException:
      WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped

      Can the definition of when @RequestScoped is active be expanded to include a WebSocket @OnMessage callback?

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            meetoblivion John Ament added a comment -

            The difference here is that JMS explicitly notes the activation of the context. WebSocket spec makes no reference to any of the CDI contexts.

            Show
            meetoblivion John Ament added a comment - The difference here is that JMS explicitly notes the activation of the context. WebSocket spec makes no reference to any of the CDI contexts.
            Hide
            miojo Bruno Borges added a comment -

            [tracking]
            Related to WEBSOCKET_SPEC-196 (https://java.net/jira/browse/WEBSOCKET_SPEC-196)

            Show
            miojo Bruno Borges added a comment - [tracking] Related to WEBSOCKET_SPEC-196 ( https://java.net/jira/browse/WEBSOCKET_SPEC-196 )
            Hide
            miojo Bruno Borges added a comment -

            What is the status on this? Will there be an errata or something?

            Show
            miojo Bruno Borges added a comment - What is the status on this? Will there be an errata or something?
            Hide
            antoinesabot-durand Antoine Sabot-Durand added a comment -

            It’s the responsibility of Websocket spec to implement these scopes. We should ensure they take the point before closing the ticket.

            Show
            antoinesabot-durand Antoine Sabot-Durand added a comment - It’s the responsibility of Websocket spec to implement these scopes. We should ensure they take the point before closing the ticket.
            Hide
            mohangundappa MohanKumar Gundappa added a comment -

            Is there any alternate solution till this get's fixed?

            Show
            mohangundappa MohanKumar Gundappa added a comment - Is there any alternate solution till this get's fixed?

              People

              • Assignee:
                antoinesabot-durand Antoine Sabot-Durand
                Reporter:
                jjsnyder Joseph Snyder
              • Votes:
                5 Vote for this issue
                Watchers:
                17 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Development