Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-91672

portletRequest.getPortletSession(false) always returns null after session expires (even if the session has been created)

    Details

    • Type: Regression Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 7.1.2 CE GA3, 7.1.X, 7.2.0 Alpha 1, 7.2.X, Master
    • Fix Version/s: None
    • Component/s: Core Infrastructure
    • Labels:
      None

      Description

      Steps to reproduce:

      1. Add the following property to portal-ext.properties:
         session.timeout=1
        
      2. Change the <session-timeout> in $LIFERAY_HOME/$TOMCAT_HOME/webapps/ROOT/WEB-INF/web.xml:
         <session-timeout>1</session-timeout>
        
      3. Start the portal.
      4. Build and deploy the attached project:
         (cd com.mycompany.my.icefaces.portlet &&
             gradle build &&
             cp build/libs/com.mycompany.my.icefaces.portlet.war $LIFERAY_HOME/deploy/.)
        
      5. Sign in.
      6. Add the portlet to a page.
      7. Navigate to the page so "Hello com.mycompany.my.icefaces.portlet!" is visible.
      8. Wait for the session to time out.
      9. Refresh the page.

      If the bug still exists, the following error message will appear in the browser:

      com.mycompany.my.icefaces.portlet is temporarily unavailable.

      The following error message will also appear in the logs:

      2019-03-06 20:30:59.027 ERROR [http-nio-8080-exec-6][render_portlet_jsp:131] null
      java.lang.NullPointerException
              at org.icefaces.impl.application.WindowScopeManager$TimeBasedHeuristicWindowScopeSharing.lookup(WindowScopeManager.java:579)
              at org.icefaces.impl.application.WindowScopeManager.determineWindowID(WindowScopeManager.java:190)
              at org.icefaces.impl.application.WindowScopeManager$DetermineOrDisposeScope.beforePhase(WindowScopeManager.java:680)
              at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
              at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:123)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
              at com.liferay.faces.bridge.internal.BridgePhaseHeaderRenderCommon.executeRender(BridgePhaseHeaderRenderCommon.java:180)
              at com.liferay.faces.bridge.internal.BridgePhaseRenderCompatImpl.execute(BridgePhaseRenderCompatImpl.java:57)
              at com.liferay.faces.bridge.internal.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:57)
              at com.liferay.faces.bridge.internal.BridgeImpl.doFacesRequest(BridgeImpl.java:161)
              at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:753)
              at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:397)
              at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:669)
              at javax.portlet.GenericPortlet.render(GenericPortlet.java:291)
              at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:127)
              at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:58)
              at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:124)
              at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
              at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:108)
      

      If the bug is fixed, "Hello com.mycompany.my.icefaces.portlet!" will appear.

      Notes:

      This error does not occur when the user logs out (instead of letting the session expire).

      This bug is caused by the fact that portletRequest.getSession(false) always returns null after the session expires even when portletRequest.getSession(true) has been called in order to create the session. This bug does not occur when the user logs out.

      This regression can also be reproduced in non-Faces JSP portlets using the following view.jsp:

      <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
      <portlet:defineObjects />
      <p>
      	<code>${renderRequest.getPortletSession(true)}</code>
      </p>
      <p>
      	<code>${renderRequest.getPortletSession(false)}</code>
      </p>
      

      The view will always show two toString() values for the current session except when the session has expired. When the session has expired, only one value will appear (the value for renderRequest.getPortletSession(true).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                support-lep@liferay.com SE Support
                Reporter:
                kyle.stiemann Kyle Stiemann (Inactive)
                Participants of an Issue:
                Recent user:
                Kyle Stiemann (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Days since last comment:
                  36 weeks ago

                  Packages

                  Version Package