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.
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)