Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-2527

NullPointerException thrown when rendering runtime JSF portlets contained in the same WAR

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: liferay-faces-3.2.5-ga6, liferay-faces-4.2.5-ga6, util-1.0.0, util-2.0.0, util-3.0.0
    • Fix Version/s: util-2.0.0, util-3.0.0
    • Component/s: Liferay Faces Util
    • Labels:
      None

      Description

      When using <portal:runtime> in a JSF portlet that tries to render a portlet contained in same WAR, it throws and exception:

      java.lang.NullPointerException
      	at com.liferay.faces.util.context.internal.FacesContextUtilImpl.release(FacesContextUtilImpl.java:49)
      	at com.liferay.faces.bridge.internal.BridgePhaseBaseImpl.cleanup(BridgePhaseBaseImpl.java:120)
      	at com.liferay.faces.bridge.internal.BridgePhaseRenderImpl.cleanup(BridgePhaseRenderImpl.java:122)
      	at com.liferay.faces.bridge.internal.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:107)
      	at com.liferay.faces.bridge.internal.BridgeImpl.doFacesRequest(BridgeImpl.java:135)
      	at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:258)
      	at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:359)
      	at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:207)
      	at javax.portlet.GenericPortlet.render(GenericPortlet.java:262)
      	at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
      	at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:55)
      	at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
      	at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
      	at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:112)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      

      Probably the FacesContext had already been released (same classloader, same ThreadLocal).

      Additionally, I saw that BridgeImpl initialization is being written twice:

      11:11:52,918 INFO  [BridgeImpl] Initializing Liferay Faces Bridge 4.2.5-ga6 (Philippi / Aug 11, 2015 AD)
      11:11:52,919 INFO  [BridgeImpl] Initializing Liferay Faces Bridge 4.2.5-ga6 (Philippi / Aug 11, 2015 AD)
      

      Attached a sample portlet.

      This issue was first posted in forums: https://www.liferay.com/community/forums/-/message_boards/message/64620508

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                util-2.0.0
                util-3.0.0