You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Mark Struberg (JIRA)" <ji...@apache.org> on 2011/08/04 10:37:27 UTC
[jira] [Created] (OWB-601) WebContextsService only works if
ServletContext is given
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
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
[jira] [Commented] (OWB-601) WebContextsService only works if
ServletContext is given
Posted by "Ronald Steininger (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Resolved] (OWB-601) WebContextsService only works if
ServletContext is given
Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Struberg resolved OWB-601.
-------------------------------
Resolution: Fixed
committed. Thanks to Ronald for the 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
[jira] [Updated] (OWB-601) WebContextsService only works if
ServletContext is given
Posted by "Ronald Steininger (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ronald Steininger updated OWB-601:
----------------------------------
Attachment: also_activate_dummy_sessionContext.patch
patch to activate dummy SessionContext
> 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