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

Fix OSGI config DB entry duplication with symbolic link

    Details

      Description

      Carrying on with LPS-113749, there are situations where that fix is not complete, so we add an additional canonical way of resolving file path.


      Steps to reproduce:

      • Operating system: SUSE Linux Enterprise Server 15 SP1
        JDK: OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
      • DXP 7.2 FP4 using liferay-dxp-tomcat-7.2.10-dxp-4-20200121112425051.7z bundle.
      • Create a symbolic link to LIFERAY_HOME directory and use this symbolic link as value for liferay.home property in portal-ext.properties file.
        • Example:
          Symbolic link as /opt/liferay/server -> /opt/liferay/liferay-dxp-7.2.10-dxp-4
          

          Then portal-ext.properties defines:

          liferay.home=/opt/liferay/server
          
      • Start DXP.

      Observed behavior:
      A java exception is thrown:

      2020-06-29 09:26:54.873 ERROR [fileinstall-/opt/liferay/server/osgi/configs][LogService:93] Failed to install artifact: /opt/liferay/liferay-dxp-7.2.10-dxp-4/osgi/configs/com.liferay.organizations.internal.configuration.OrganizationTypeConfiguration-default.config
      com.liferay.portal.configuration.persistence.listener.ConfigurationModelListenerException: The listener com.liferay.organizations.internal.configuration.persistence.listener.OrganizationTypeConfigurationModelListener was unable to save configuration com.liferay.organizations.internal.configuration.OrganizationTypeConfiguration.
      at com.liferay.organizations.internal.configuration.persistence.listener.OrganizationTypeConfigurationModelListener.onBeforeSave(OrganizationTypeConfigurationModelListener.java:57)
      at com.liferay.portal.configuration.persistence.internal.ConfigurationPersistenceManager.store(ConfigurationPersistenceManager.java:219)
      at org.apache.felix.cm.impl.persistence.PersistenceManagerProxy.store(PersistenceManagerProxy.java:203)
      at org.apache.felix.cm.impl.ConfigurationImpl.update(ConfigurationImpl.java:461)
      at org.apache.felix.cm.impl.ConfigurationAdapter.update(ConfigurationAdapter.java:145)
      at org.apache.felix.fileinstall.internal.ConfigInstaller.setConfig(ConfigInstaller.java:307)
      at org.apache.felix.fileinstall.internal.ConfigInstaller.install(ConfigInstaller.java:99)
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:962)
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:896)
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:493)
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:369)
      at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:320)
      at org.apache.felix.fileinstall.internal.FileInstall.updated(FileInstall.java:255)
      at org.apache.felix.fileinstall.internal.FileInstall.start(FileInstall.java:132)
      at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:779)
      at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:772)
      at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:729)
      at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1002)
      at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:354)
      at org.eclipse.osgi.container.Module.doStart(Module.java:581)
      at org.eclipse.osgi.container.Module.start(Module.java:449)
      at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428)
      at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:447)
      at com.liferay.portal.bootstrap.ModuleFrameworkImpl._startDynamicBundles(ModuleFrameworkImpl.java:1865)
      at com.liferay.portal.bootstrap.ModuleFrameworkImpl.startFramework(ModuleFrameworkImpl.java:404)
      at com.liferay.portal.module.framework.ModuleFrameworkUtilAdapter.startFramework(ModuleFrameworkUtilAdapter.java:100)
      at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:300)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4682)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5150)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:713)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:695)
      at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:631)
      at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1832)
      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
      at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
      at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:526)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:425)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1577)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
      at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
      at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:929)
      at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1377)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1367)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
      at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:902)
      at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.StandardService.startInternal(StandardService.java:423)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:928)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:634)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
      

      Please, note that file path

       /opt/liferay/liferay-dxp-7.2.10-dxp-4/osgi/configs/com.liferay.organizations.internal.configuration.OrganizationTypeConfiguration-default.config
      

      is been using instead of

       /opt/liferay/server/osgi/configs/com.liferay.organizations.internal.configuration.OrganizationTypeConfiguration-default.config
      

      This is because the file is procesed twice: one with /opt/liferay/server/... and another with /opt/liferay/liferay-dxp-7.2.10-dxp-4/... And this one causes the exception.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              summer.zhang Summer Zhang
              Reporter:
              sergio.alonso Sergio Alonso
              Participants of an Issue:
              Recent user:
              Jason Pince
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 13 weeks, 3 days ago

                  Packages

                  Version Package
                  7.2.10 DXP FP7
                  7.2.X
                  7.3.4 CE GA5
                  7.3.10 DXP GA1
                  Master