2 Replies Latest reply on Nov 2, 2011 5:34 AM by gerhard1973

    Which Lifecycle implementation should the portlet be using?

    gareth_western

      Hi,

      I'm trying out Richfaces 3.3.3.FINAL in WebSphere Portal 6.1.5 running in WebSphere Application Server 7.0.0.11, using the 2.0.0.FINAL JBoss portlet bridge. The "echo" portlet demo appears to work correctly, however in the WebSphere logs I see the following error message every time an ajax request is fired:

       

      com.ibm.ws.portletcontainer.core.impl.PortletRequestImpl setCharacterEncoding EJPPC0170E: Cannot set character encoding after HTTP-Body has been accessed

       

      Now I think this is something to do with the IBM implementation of... something... so I started stepping down through the source code to find exactly where the message is coming out. I traced the call down to

      org.jboss.portletbridge.AjaxPortletBridge#execute(FacesContext context)
      

      where it appears that getFacesLifecycle() is returning an instance of

      com.sun.faces.lifecycle.LifecycleImpl
      

      which in turn calls phase.doPhase for each of the JSF phases. The error message mentioned above appears to be thrown when

      com.sun.faces.lifecycle.RestoreViewPhase
      

      is called. But I was thinking that getFacesLifecycle() should have returned an instance of

       org.jboss.portletbridge.lifecycle.PortletLifecycle 

      instead of the Sun implementation. So, is the observed behaviour correct, or is there a problem somewhere in my configuration of RichFaces / the bridge, or is it all still further down the stack inside WebSphere somewhere?

        • 1. Re: Which Lifecycle implementation should the portlet be using?
          gareth_western

          Well, I was able to suppress the error message by implementing my own Filter and ResourceRequest/Response wrappers for the RESOURCE_PHASE, as mentioned in a thread over on the IBM forums. So I guess the portlet bridge is behaving correctly.

           

          I would like to know, just out of interest, why the bridge is using the sun Lifecycle implementation rather than the PortletLifecycleImplementation. Can anyone shed some light on the matter?

          1 of 1 people found this helpful
          • 2. Re: Which Lifecycle implementation should the portlet be using?
            gerhard1973

            Hi Gareth!

             

            I'm new to Portlets and facing also this Error

             

            [02.11.11 09:21:28:944 CET] 00000030 PortletReques E com.ibm.ws.portletcontainer.core.impl.PortletRequestImpl setCharacterEncoding EJPPC0170E: Es kann keine Zeichencodierung nach dem Zugriff auf HTTP-Body gesetzt werden.

            in a remote Portlet (using JSF 1.2 and Facelets) on Websphere 7.0.0.17 consumd via IBM WSRP 2.0 from Liferay Portal.

             

            In the "thread over on the IBM forums" I understand that a ResourceRequest/Response wrappers could be useful for me,

            but the code provided in the .war files is related to IBM's portletbridge, that is not working for me.

             

            Would you be so kind and provide some code for me, how you implemented your own Filter and ResourceRequest/Response wrappers for the RESOURCE_PHASE.

             

            Best Regards,

            Gerhard