You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Ronald Steininger (JIRA)" <ji...@apache.org> on 2011/08/16 12:32:27 UTC

[jira] [Commented] (OWB-601) WebContextsService only works if ServletContext is given

    [ https://issues.apache.org/jira/browse/OWB-601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13085626#comment-13085626 ] 

Ronald Steininger commented on OWB-601:
---------------------------------------

The created dummy SessionContext (which gets created if the HttpSession is null) doesn't work since it doesn't get activated. I'll attach a patch.

> WebContextsService only works if ServletContext is given
> --------------------------------------------------------
>
>                 Key: OWB-601
>                 URL: https://issues.apache.org/jira/browse/OWB-601
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Java EE Integration
>    Affects Versions: 1.1.0
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.1.1
>
>         Attachments: also_activate_dummy_sessionContext.patch
>
>
> 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)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira