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

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 5.1.2, 5.2.2, 5.2.3, 6.0.0 Preview
    • 6.0.1 RC
    • None
    • 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
    • 5.2.x, 5.1.x
    • Committed
    • 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

              zsolt.balogh Zsolt Balogh
              blairm Blair M (Inactive)
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12 years, 31 weeks, 4 days ago

                Packages

                  Version Package
                  6.0.1 RC