Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Beta1
    • Fix Version/s: 2.0-Beta2, 2.0.0
    • Component/s: Sample Apps
    • Labels:
      None
    • Environment:
      ICEfaces 2 JSF 2 portlet
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial

      Description

      To test and demonstrate best practices for developing portlets using the new PortletFaces bridge, we need to upgrade our existing chat sample application.

        Issue Links

          Activity

          Hide
          Deryk Sinotte added a comment -

          The chat portlet example is checked in and working with push in some fashion but there are still some issues. Ones that I know of are:

          1) When sending a chat message, the portlet will sometimes "blow up" so that it's in it's own page. This is rare when there is only a single instance on the page but becomes easier to recreate the more instances that are added. Still looking at this.

          2) It appears that Push requests are occasionally leading to:

          java.lang.NullPointerException
          at javax.faces.context.FacesContext.setCurrentInstance(FacesContext.java:770)
          at com.sun.faces.context.FacesContextImpl.release(FacesContextImpl.java:562)
          at org.portletfaces.bridge.BridgeImpl.cleanupFacesContext(BridgeImpl.java:325)
          at org.portletfaces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:295)
          at org.portletfaces.bridge.GenericFacesPortlet.serveResource(GenericFacesPortlet.java:173)
          at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:119)
          at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
          at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:92)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

          Show
          Deryk Sinotte added a comment - The chat portlet example is checked in and working with push in some fashion but there are still some issues. Ones that I know of are: 1) When sending a chat message, the portlet will sometimes "blow up" so that it's in it's own page. This is rare when there is only a single instance on the page but becomes easier to recreate the more instances that are added. Still looking at this. 2) It appears that Push requests are occasionally leading to: java.lang.NullPointerException at javax.faces.context.FacesContext.setCurrentInstance(FacesContext.java:770) at com.sun.faces.context.FacesContextImpl.release(FacesContextImpl.java:562) at org.portletfaces.bridge.BridgeImpl.cleanupFacesContext(BridgeImpl.java:325) at org.portletfaces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:295) at org.portletfaces.bridge.GenericFacesPortlet.serveResource(GenericFacesPortlet.java:173) at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:119) at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71) at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          Hide
          Deryk Sinotte added a comment -

          So for issue #2 noted above, there always seems to be an INFO level message posted just before the NPE:

          22:40:17,741 INFO [PortalImpl:3812] Current URL /web/guest/chat?_chat_WAR_ice2portlet_INSTANCE_aqI2_javax.faces.resource=listen.icepush&p_p_cacheability=cacheLevelPage&p_p_col_count=2&p_p_col_id=column-1&p_p_id=chat_WAR_ice2portlet_INSTANCE_aqI2&p_p_lifecycle=2&p_p_mode=view&p_p_state=normal generates exception: null
          22:40:17,761 ERROR [jsp:?] java.lang.NullPointerException
          java.lang.NullPointerException
          at javax.faces.context.FacesContext.setCurrentInstance(FacesContext.java:770)
          at com.sun.faces.context.FacesContextImpl.release(FacesContextImpl.java:562)
          at org.portletfaces.bridge.BridgeImpl.cleanupFacesContext(BridgeImpl.java:325)
          at org.portletfaces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:295)
          at org.portletfaces.bridge.GenericFacesPortlet.serveResource(GenericFacesPortlet.java:173)
          at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:119)
          at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
          at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:92)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

          The NPE itself occurs in the FacesContext.setCurrentInstance method:

          protected static void setCurrentInstance(FacesContext context) {

          if (context == null)

          { instance.remove(); }

          else

          { instance.set(context); }

          }

          where if the FacesContext is null, it tries to call remove on the ThreadLocal (instance) but that instance is null. Since it's likely a Push request, perhaps the bridge needs to have more info before tyring to release the current FacesContext reference.

          Show
          Deryk Sinotte added a comment - So for issue #2 noted above, there always seems to be an INFO level message posted just before the NPE: 22:40:17,741 INFO [PortalImpl:3812] Current URL /web/guest/chat?_chat_WAR_ice2portlet_INSTANCE_aqI2_javax.faces.resource=listen.icepush&p_p_cacheability=cacheLevelPage&p_p_col_count=2&p_p_col_id=column-1&p_p_id=chat_WAR_ice2portlet_INSTANCE_aqI2&p_p_lifecycle=2&p_p_mode=view&p_p_state=normal generates exception: null 22:40:17,761 ERROR [jsp:?] java.lang.NullPointerException java.lang.NullPointerException at javax.faces.context.FacesContext.setCurrentInstance(FacesContext.java:770) at com.sun.faces.context.FacesContextImpl.release(FacesContextImpl.java:562) at org.portletfaces.bridge.BridgeImpl.cleanupFacesContext(BridgeImpl.java:325) at org.portletfaces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:295) at org.portletfaces.bridge.GenericFacesPortlet.serveResource(GenericFacesPortlet.java:173) at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:119) at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71) at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) The NPE itself occurs in the FacesContext.setCurrentInstance method: protected static void setCurrentInstance(FacesContext context) { if (context == null) { instance.remove(); } else { instance.set(context); } } where if the FacesContext is null, it tries to call remove on the ThreadLocal (instance) but that instance is null. Since it's likely a Push request, perhaps the bridge needs to have more info before tyring to release the current FacesContext reference.
          Hide
          Deryk Sinotte added a comment -

          As for issue #1, it seems simple enough to replicate.

          1) Add two instances of the chat portlet to one page
          2) Login to the first one and chat.
          3) Login to the second one and chat.
          4) Go back to the first one and try to chat.

          The partial update that comes back is a ViewRoot update but is rooted on the div containing the portlet. Since it's a ViewRoot style update, the entire page is replaced rather than just the parent div of the portlet.

          ?xml version='1.0' encoding='UTF-8'?>
          <partial-response><changes><update id="javax.faces.ViewRoot"><![CDATA[<div class="portletfaces-bridge-body">

          Show
          Deryk Sinotte added a comment - As for issue #1, it seems simple enough to replicate. 1) Add two instances of the chat portlet to one page 2) Login to the first one and chat. 3) Login to the second one and chat. 4) Go back to the first one and try to chat. The partial update that comes back is a ViewRoot update but is rooted on the div containing the portlet. Since it's a ViewRoot style update, the entire page is replaced rather than just the parent div of the portlet. ?xml version='1.0' encoding='UTF-8'?> <partial-response><changes><update id="javax.faces.ViewRoot"><![CDATA[<div class="portletfaces-bridge-body">
          Hide
          Deryk Sinotte added a comment -

          The migration of the Chat portlet is complete.

          Show
          Deryk Sinotte added a comment - The migration of the Chat portlet is complete.

            People

            • Assignee:
              Deryk Sinotte
              Reporter:
              Deryk Sinotte
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: