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

System Settings are not properly stored and cannot be properly retrieved from the database when comments are included in a configuration file (Continued)


    • 3


      This is a continuation of LPS-86754, the original fix did not actually resolve the issue.


      When a configuration file is used to provide a System Setting and the file contains a comment, the configuration is improperly stored in the database.

      This may lead to inconsistent behavior, such as:

      • Orphaned configuration entries in the database
      • Inability to read the configuration entry that is stored in the database

      Steps to Reproduce

      1. Startup Liferay
      2. Navigate to Control Panel -> System Settings -> Blogs
      3. Verify that entry: Entry Check Interval = 1
      4. Create an OSGI Config file: [LIFERAY_HOME]/osgi/configs/com.liferay.blogs.configuration.BlogsConfiguration.config
      5. Wait at least 10 seconds for Liferay to update the configuration using our Config file
      6. Go back to the browser
      7. Verify that entry: Entry Check Interval = 5
      8. Modify our created OSGI Config file
      9. Wait at least 10 seconds for Liferay to update the configuration using our Config file
      10. Go back to the browser
      11. Verify entry for: Entry Check Interval

      Expected Results
      Entry Check Interval = 5

      Actual Results
      Entry Check Interval = 1

      Additional Check:

      1. Check the database table: Configuration_
      2. Lookup the value for the configurationId: com.liferay.blogs.configuration.BlogsConfiguration
      3. The dictionary includes an unexpected entry:

      The scenario above, helps demonstrate the issue in master, 72x, 71x, and 70x.
      The above scenario demonstrates a minor effect of adding a comment.

      A more dramatic effect would be to test using a commented multi-value entry.
      Currently, this is most noticeable when testing using the master branch.

      Steps to Reproduce

      1. Create an OSGI Config file: [LIFERAY_HOME]/osgi/configs/com.liferay.blogs.configuration.BlogsConfiguration.config
      2. Startup Liferay and wait for startup to complete
      3. Restart Liferay
      4. Examine Logs

      Expected Results
      No errors are shown in the logs

      Actual Results
      Errors are shown in the logs regarding the configuration

      Additional Notes

      • Modifying/removing the added config file does not resolve the issue.
      • Modifying the Blog Configuration within System Settings in Control Panel also does not resolve the issue.

      Sample: NullPointerException Message

      2019-03-08 02:11:29.877 ERROR [fileinstall-/Users/liferay/Liferay/development/deploy/liferay/master/osgi/configs][org_apache_felix_fileinstall:97] Failed to install artifact: /Users/liferay/Liferay/development/deploy/liferay/master/osgi/configs/com.liferay.blogs.configuration.BlogsConfiguration.config
      	at org.apache.felix.cm.impl.helper.TargetedPID.<init>(TargetedPID.java:61)
      	at org.apache.felix.cm.impl.ConfigurationImpl.<init>(ConfigurationImpl.java:183)
      	at org.apache.felix.cm.impl.ConfigurationManager.getConfiguration(ConfigurationManager.java:452)
      	at org.apache.felix.cm.impl.ConfigurationAdminImpl.getConfiguration(ConfigurationAdminImpl.java:164)
      	at org.apache.felix.fileinstall.internal.ConfigInstaller.getConfiguration(ConfigInstaller.java:346)
      	at org.apache.felix.fileinstall.internal.ConfigInstaller.setConfig(ConfigInstaller.java:252)
      	at org.apache.felix.fileinstall.internal.ConfigInstaller.install(ConfigInstaller.java:78)
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:937)
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:871)
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:485)
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)


        Issue Links



              support-lep@liferay.com SE Support
              eric.yan Eric Yan
              Kiyoshi Lee Kiyoshi Lee
              0 Vote for this issue
              1 Start watching this issue


                1 year, 48 weeks, 4 days ago


                  Version Package