Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1.0
-
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)