javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2508

CompositeComponentAttributeELResolver$ExpressionEvalMap caches FacesContext and fails in Portlet bridge renderRequest because cached FacesContext is released

    Details

      Description

      With Portlet 2 bridge two distinct instances of FacesContext are used for the two Portlet phases (request processing, response rendering). Now since FacesContext is cached in CompositeComponentAttributeELResolver$ExpressionEvalMap and as it seems the ELResolver's are reused by the Portlet Bridge for the two phases, during render response an already released FacesContext instance is causing:

      	java.lang.IllegalStateException
      	at com.sun.faces.context.FacesContextImpl.assertNotReleased(FacesContextImpl.java:655)
      	at com.sun.faces.context.FacesContextImpl.getELContext(FacesContextImpl.java:250)
      	at javax.faces.context.FacesContextWrapper.getELContext(FacesContextWrapper.java:341)
      	at com.sun.faces.el.CompositeComponentAttributesELResolver$ExpressionEvalMap.get(CompositeComponentAttributesELResolver.java:349)
      	at javax.el.MapELResolver.getValue(MapELResolver.java:164)
      	.... 
      

      To make this save, the cached FacesContext should be queried for it's release state and in case it's released re-cache the current FacesContext.getCurrentInstance() to make this Portlet save.

      1. changebundle.txt
        8 kB
        Manfred Riem
      2. changebundle.txt
        1 kB
        Hanspeter Duennenberger
      3. Exception in CompositeComponentAttributeELResolver in Portlet render phase.txt
        13 kB
        Hanspeter Duennenberger

        Activity

        Hanspeter Duennenberger created issue -
        Hanspeter Duennenberger made changes -
        Field Original Value New Value
        Attachment changebundle.txt [ 51055 ]
        Hanspeter Duennenberger made changes -
        Assignee Hanspeter Duennenberger [ dueni ]
        Hanspeter Duennenberger made changes -
        Attachment changebundle.txt [ 51055 ]
        Hanspeter Duennenberger made changes -
        Attachment changebundle.txt [ 51084 ]
        Hanspeter Duennenberger made changes -
        Attachment changebundle.txt [ 51084 ]
        Hanspeter Duennenberger made changes -
        Attachment changebundle.txt [ 51085 ]
        Manfred Riem made changes -
        Assignee Hanspeter Duennenberger [ dueni ] Manfred Riem [ mriem ]
        Manfred Riem made changes -
        Attachment changebundle.txt [ 51093 ]
        Attachment newfiles.zip [ 51094 ]
        Manfred Riem made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 2.1.14 [ 16014 ]
        Fix Version/s 2.2-m06 [ 15885 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Manfred Riem
            Reporter:
            Hanspeter Duennenberger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: