MyFaces Orchestra
  1. MyFaces Orchestra
  2. ORCHESTRA-18

Cannot get access-scoped beans from a servlet

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        88d 8h 55m 1 Simon Kitching 29/Jun/08 18:42
        Simon Kitching made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Simon Kitching added a comment -

        Fixed in trunk, will be in the 1.2 release.

        Show
        Simon Kitching added a comment - Fixed in trunk, will be in the 1.2 release.
        Hide
        Simon Kitching added a comment -

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

        Show
        Simon Kitching added a comment - This issue should be fixed by the new SpringBasicFrameworkAdapter class available in Orchestra trunk (which will be in Orchestra 1.2).
        Simon Kitching created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Simon Kitching
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development