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

<user-principal-strategy>screenName</user-principal-strategy> Causes NPE and logs the error - filling up the logs

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 5.1.2, 5.2.2, 5.2.3, 6.0.0 Preview
    • Fix Version/s: 6.0.1 RC
    • Labels:
      None
    • Environment:
      Linux version 2.6.22.19-0.2-bigsmp ([email protected]) (gcc version 4.2.1 (SUSE Linux)) #1 SMP 2008-12-18 10:17:03 +0100
      Oracle 10
      Tomcat 5.5
    • Branch Version/s:
      5.2.x, 5.1.x
    • Backported to Branch:
      Committed
    • Liferay Contributor's Agreement:
      Accept

      Description

      If you develop custom portlets and use <user-principal-strategy>screenName</user-principal-strategy> in the liferay-portlet.xml file, a NPE will get generated in PortletServletRequest.java.

      Lines 88 - 100 look to see what the strategy the portlet uses and if it is screen name it grabs the User from PortalUtil.getUser but it does check to see if the user is null, it only employs a try catch block and logs the error. This will destroy a log file if someone puts a custom portlet on a page that is accessible by guests.

      To fix this, either put in a null check or change the level of the logging event from error.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              zsolt.balogh Zsolt Balogh
              Reporter:
              blairm Blair M (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                11 years, 29 weeks, 6 days ago

                  Packages

                  Version Package
                  6.0.1 RC