[ 
https://issues.apache.org/jira/browse/ORCHESTRA-18?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607631#action_12607631
 ] 

Simon Kitching commented on ORCHESTRA-18:
-----------------------------------------

This issue should be fixed by the new SpringBasicFrameworkAdapter class 
available in Orchestra trunk (which will be in Orchestra 1.2).

> Cannot get access-scoped beans from a servlet
> ---------------------------------------------
>
>                 Key: ORCHESTRA-18
>                 URL: https://issues.apache.org/jira/browse/ORCHESTRA-18
>             Project: MyFaces Orchestra
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Simon Kitching
>
> As reported by Stephan Frai:
> A servlet does this:
> ApplicationContext appContext = 
> WebApplicationContextUtils.getWebApplicationContext(getServletContext());
> PwdForgottenJSF pwdForgottenBean = (PwdForgottenJSF) 
> appContext.getBean("pwdForgottenJSF");
> web.xml is set up to correctly map a BasicFrameworkAdapter to the current 
> request. 
> But when pwdForgottenJSF is access-scoped, then this occurs:
> SCHWERWIEGEND: Servlet.service() for servlet ControllerServlet threw exception
> java.lang.IllegalArgumentException: No AccessScopeManager found. 
>  at ...conversation.AccessScopeManager.getInstance(AccessScopeManager.java:97)
>  at 
> ...conversation.ConversationAccessLifetimeAspect.markAsAccessed(ConversationAccessLifetimeAspect.java:35)
>  at 
> ...conversation.spring.SpringConversationScope.notifyAccessConversation(SpringConversationScope.java:194)
>  at 
> ....conversation.spring.AbstractSpringOrchestraScope.getRealBean(AbstractSpringOrchestraScope.java:333)
> The problem is that the AccessScopeManager.getInstance method calls 
> frameworkAdapter.getBean(....), but a BasicFrameworkAdapter has no knowledge 
> of Spring; it just looks up request/session/application scopes.
> A possible workaround is for the servlet to manually fetch the 
> AccessScopeManager instance and store it in the request scope.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to