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

Database upgrade tool ends up with painless exception

    Details

      Description

      This is only reproducible in DXP profiles but we need to commit it to master since it's the base of future DXP versions too.

      Steps to reproduce it:

      1. Start a DXP 7.1. For master you will need to deploy master with master-private making the following change in the portal-kernel to simulate that you are using a DXP edition:
        1. In com.liferay.portal.kernel.util.ReleaseInfo.java remove the word Community from the property _name:
          private static final String _NAME = "Liferay Edition Portal";
      2. Once is started up, shutdown it
      3. Execute the DB Upgrade Tool against that database

      Results:
      You get the following exception at the end:

      2018-10-04 15:34:59.961 ERROR [SCR Component Actor][com_liferay_portal_properties_swapper:97] [com.liferay.portal.properties.swapper.internal.DefaultCompanyNameSwapper(3916)] The activate method has thrown an exception 
      java.lang.ArrayIndexOutOfBoundsException: 0
              at com.liferay.portal.util.PortalInstances.getDefaultCompanyId(PortalInstances.java:202)
              at com.liferay.portal.properties.swapper.internal.DefaultCompanyNameSwapper.activate(DefaultCompanyNameSwapper.java:50)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:224)
              at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)
              at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:617)
              at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:501)
              at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:302)
              at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:294)
              at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:297)
              at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:108)
              at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:906)
              at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:879)
              at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:748)
              at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:674)
              at org.apache.felix.scr.impl.manager.AbstractComponentManager$1.run(AbstractComponentManager.java:452)
              at org.apache.felix.scr.impl.ComponentActorThread.run(ComponentActorThread.java:103)
              at java.lang.Thread.run(Thread.java:748)
      

      Technical explanation:
      The module Portal Properties swapper is activated and it access to PortalInstances.getDefaultCompanyId() which is not initialized. This module shouldn't run during an upgrade process.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abel.yu Abel Yu (Inactive)
                Reporter:
                alberto.chaparro Alberto Chaparro
                Participants of an Issue:
                Recent user:
                Annie Wu
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  49 weeks, 2 days ago

                  Packages

                  Version Package
                  7.0.X
                  7.1.X
                  Master