MyFaces CODI
  1. MyFaces CODI
  2. EXTCDI-184

mojarra causes a ContextNotActiveException

    Details

      Description

      ContextNotActiveException is caused by an access of a context and #isActive returns false.

      the implementation of #isActive for codi scopes is:
      return FacesContext.getCurrentInstance().getExternalContext().getSession(false) != null;

      that means a session is required and you just have to ensure that your application doesn't close it and tries to access a codi scope afterwards.

        Activity

        Gerhard Petracek created issue -
        Gerhard Petracek made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Won't Fix [ 2 ]
        Gerhard Petracek made changes -
        Fix Version/s 1.0.0 [ 12316424 ]
        Affects Version/s 0.9.5 [ 12316338 ]
        Gerhard Petracek made changes -
        Resolution Won't Fix [ 2 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Gerhard Petracek added a comment -

        workaround for mojarra: if it is a request, we have to force the creation of a new session.
        it's possible to deactivate this behaviour via: org.apache.myfaces.extensions.cdi.FORCE_SESSION_CREATION

        Show
        Gerhard Petracek added a comment - workaround for mojarra: if it is a request, we have to force the creation of a new session. it's possible to deactivate this behaviour via: org.apache.myfaces.extensions.cdi.FORCE_SESSION_CREATION
        Gerhard Petracek made changes -
        Summary ContextNotActiveException mojarra causes a ContextNotActiveException
        Priority Trivial [ 5 ] Minor [ 4 ]
        Description this is a placeholder issue for all kinds of ContextNotActiveExceptions in combination with codi scopes.
        if further issues will be reported, we can use this issue as a reference.

        ContextNotActiveException is caused by an access of a context and #isActive returns false.

        the implementation of #isActive for codi scopes is:
        return FacesContext.getCurrentInstance().getExternalContext().getSession(false) != null;

        that means a session is required and you just have to ensure that your application doesn't close it and tries to access a codi scope afterwards.

        if your application is ok and you see this exception, contact the weld and/or mojarra community because it can't be a codi bug.
        ContextNotActiveException is caused by an access of a context and #isActive returns false.

        the implementation of #isActive for codi scopes is:
        return FacesContext.getCurrentInstance().getExternalContext().getSession(false) != null;

        that means a session is required and you just have to ensure that your application doesn't close it and tries to access a codi scope afterwards.
        Gerhard Petracek made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Gerhard Petracek made changes -
        Component/s JEE-JSF12-Module [ 12313496 ]
        Component/s JEE-JSF20-Module [ 12313497 ]
        Gerhard Petracek made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Gerhard Petracek made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Gerhard Petracek made changes -
        Assignee Gerhard Petracek [ gpetracek ]
        Gerhard Petracek made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Gerhard Petracek
            Reporter:
            Gerhard Petracek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development