Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-601

WebContextsService only works if ServletContext is given

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.0
    • 1.1.1
    • Java EE Integration
    • None

    Description

      WebContextsService#initRequestContext can only be started if you supply a ServletRequestEvent.
      This is not possible for threads which get started asynchronous, e.g. to handle a long running action.

      In this case the following Exception gets thrown when accessing the RequestScope:

      javax.enterprise.context.ContextNotActiveException: WebBeans context
      with scope type annotation @RequestScoped does not exist within
      current thread
      at org.apache.webbeans.container.BeanManagerImpl.getContext(BeanManagerImpl.java:341)
      at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:124)
      at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:95)

      Attachments

        1. also_activate_dummy_sessionContext.patch
          0.8 kB
          Ronald Steininger

        Activity

          People

            struberg Mark Struberg
            struberg Mark Struberg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: