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

Cannot create first company if available "locales" set in portal-ext.properties does not contain the system's locale

    Details

    • Fix Priority:
      4

      Description

      Description
      The default user may not always be available when trying to initialize a CompanyLocalesBag (in this case, when creating the first company on startup). Therefore there needs to be a null case properly handled to prevent a NPE from being thrown on first portal startup to prevent breaking the portal. When trying to get the default locale in CompanyLocalesBag, if the system locale (set as the default locale in LocaleThreadLocale by default), portal will fallback by trying to get the current default user's default locale, which can not be yet existing on portal startup, causing a NPE to occur.

      Note
      This cannot be reproduced if locales is not changed in the portal-ext.properties since a portal admin's system locale will likely be in the list of default locales allowed in the default property set in the portal.properties

      Required portal-ext.properties (If your system locale is es_ES, then replace es_ES with something else like en_US)
      company.default.locale=es_ES
      locales.enabled=es_ES
      locales=es_ES

      Steps to Reproduce

      1. Start a Clean portal bundle

      Expected Result
      Portal starts up succesfully

      Actual Result
      Portal fails to start due to NPE being thrown when creating the first company

      Tested on Tomcat 9.0.37 + PostgreSQL 10.6
      Portal master GIT ID: 548f3899675d89749f92b7623d25e27d0c4691c7

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              kyle.miho Kyle Miho
              Participants of an Issue:
              Recent user:
              Liferay JIRA Bot
              Engineering Assignee:
              Tina Tian
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Days since last comment:
                14 weeks ago

                  Packages

                  Version Package
                  Master