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

MVCCVersionUpgradeProcess throws NullPointerException

    Details

      Description

      Steps to reproduce

      1. Create 1 or more web contents in 7.1 using, say, MySQL
      2. Upgrade the database to 7.4 directly using DB Upgrader tool

      Expected behavior

      All upgrades finish successfully

      Current behavior

      Upgrades for com.liferay.journal.service are pending and when the user executes upgrade:execute com.liferay.journal.service in the Gogo Shell a NullPointerException is thrown.

      2021-11-23 11:04:24.933 ERROR [pipe-upgrade:execute com.liferay.journal.service][ReleaseManagerOSGiCommands:86] Failed upgrade process for module com.liferay.journal.service
      com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.xml.DocumentException
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:120) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:138) ~[portal-kernel.jar:?]
      	at com.liferay.portal.upgrade.internal.executor.UpgradeExecutor$UpgradeInfosRunnable.run(UpgradeExecutor.java:199) ~[?:?]
      	at com.liferay.portal.output.stream.container.internal.OutputStreamContainerFactoryTrackerImpl.runWithSwappedLog(OutputStreamContainerFactoryTrackerImpl.java:134) [bundleFile:?]
      	at com.liferay.portal.upgrade.internal.executor.SwappedLogExecutor.execute(SwappedLogExecutor.java:51) [bundleFile:?]
      	at com.liferay.portal.upgrade.internal.executor.UpgradeExecutor.executeUpgradeInfos(UpgradeExecutor.java:154) ~[bundleFile:?]
      	at com.liferay.portal.upgrade.internal.executor.UpgradeExecutor.execute(UpgradeExecutor.java:117) ~[bundleFile:?]
      	at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.execute(ReleaseManagerOSGiCommands.java:81) [bundleFile:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_292]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_292]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_292]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_292]
      	at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:143) [bundleFile:?]
      	at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:91) [bundleFile:?]
      	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) [bundleFile:?]
      	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) [bundleFile:?]
      	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) [bundleFile:?]
      	at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) [bundleFile:?]
      	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [bundleFile:?]
      	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [bundleFile:?]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_292]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_292]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_292]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]
      Caused by: com.liferay.portal.kernel.xml.DocumentException
      	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:372) ~[portal-impl.jar:?]
      	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:346) ~[portal-impl.jar:?]
      	at com.liferay.portal.kernel.xml.UnsecureSAXReaderUtil.read(UnsecureSAXReaderUtil.java:46) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.MVCCVersionUpgradeProcess.getClassElements(MVCCVersionUpgradeProcess.java:98) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.MVCCVersionUpgradeProcess.upgradeClassElementMVCCVersions(MVCCVersionUpgradeProcess.java:117) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.MVCCVersionUpgradeProcess.doUpgrade(MVCCVersionUpgradeProcess.java:86) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.lambda$upgrade$0(UpgradeProcess.java:114) ~[portal-kernel.jar:?]
      	at com.liferay.portal.db.partition.DBPartitionUtil.forEachCompanyId(DBPartitionUtil.java:113) ~[portal-impl.jar:?]
      	at com.liferay.portal.dao.db.BaseDB.process(BaseDB.java:307) ~[portal-impl.jar:?]
      	at com.liferay.portal.kernel.dao.db.BaseDBProcess.process(BaseDBProcess.java:241) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:101) ~[portal-kernel.jar:?]
      	... 23 more
      Caused by: org.dom4j.DocumentException
      	at org.dom4j.io.SAXReader.read(SAXReader.java:513) ~[dom4j.jar:?]
      	at org.dom4j.io.SAXReader.read(SAXReader.java:392) ~[dom4j.jar:?]
      	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:368) ~[portal-impl.jar:?]
      	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:346) ~[portal-impl.jar:?]
      	at com.liferay.portal.kernel.xml.UnsecureSAXReaderUtil.read(UnsecureSAXReaderUtil.java:46) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.MVCCVersionUpgradeProcess.getClassElements(MVCCVersionUpgradeProcess.java:98) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.MVCCVersionUpgradeProcess.upgradeClassElementMVCCVersions(MVCCVersionUpgradeProcess.java:117) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.MVCCVersionUpgradeProcess.doUpgrade(MVCCVersionUpgradeProcess.java:86) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.lambda$upgrade$0(UpgradeProcess.java:114) ~[portal-kernel.jar:?]
      	at com.liferay.portal.db.partition.DBPartitionUtil.forEachCompanyId(DBPartitionUtil.java:113) ~[portal-impl.jar:?]
      	at com.liferay.portal.dao.db.BaseDB.process(BaseDB.java:307) ~[portal-impl.jar:?]
      	at com.liferay.portal.kernel.dao.db.BaseDBProcess.process(BaseDBProcess.java:241) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:101) ~[portal-kernel.jar:?]
      	... 23 more
      Caused by: java.net.MalformedURLException
      	at java.net.URL.<init>(URL.java:645) ~[?:1.8.0_292]
      	at java.net.URL.<init>(URL.java:508) ~[?:1.8.0_292]
      	at java.net.URL.<init>(URL.java:457) ~[?:1.8.0_292]
      	at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) ~[xercesImpl.jar:2.12.0]
      	at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source) ~[xercesImpl.jar:2.12.0]
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl.jar:?]
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl.jar:?]
      	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) ~[xercesImpl.jar:?]
      	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) ~[xercesImpl.jar:?]
      	at com.liferay.portal.security.xml.StripDoctypeXMLReader.parse(StripDoctypeXMLReader.java:138) ~[portal-impl.jar:?]
      	at org.dom4j.io.SAXReader.read(SAXReader.java:494) ~[dom4j.jar:?]
      	at org.dom4j.io.SAXReader.read(SAXReader.java:392) ~[dom4j.jar:?]
      	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:368) ~[portal-impl.jar:?]
      	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:346) ~[portal-impl.jar:?]
      	at com.liferay.portal.kernel.xml.UnsecureSAXReaderUtil.read(UnsecureSAXReaderUtil.java:46) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.MVCCVersionUpgradeProcess.getClassElements(MVCCVersionUpgradeProcess.java:98) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.MVCCVersionUpgradeProcess.upgradeClassElementMVCCVersions(MVCCVersionUpgradeProcess.java:117) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.MVCCVersionUpgradeProcess.doUpgrade(MVCCVersionUpgradeProcess.java:86) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.lambda$upgrade$0(UpgradeProcess.java:114) ~[portal-kernel.jar:?]
      	at com.liferay.portal.db.partition.DBPartitionUtil.forEachCompanyId(DBPartitionUtil.java:113) ~[portal-impl.jar:?]
      	at com.liferay.portal.dao.db.BaseDB.process(BaseDB.java:307) ~[portal-impl.jar:?]
      	at com.liferay.portal.kernel.dao.db.BaseDBProcess.process(BaseDBProcess.java:241) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:101) ~[portal-kernel.jar:?]
      	... 23 more
      Caused by: java.lang.NullPointerException
      	at java.net.URL.<init>(URL.java:550) ~[?:1.8.0_292]
      	at java.net.URL.<init>(URL.java:508) ~[?:1.8.0_292]
      	at java.net.URL.<init>(URL.java:457) ~[?:1.8.0_292]
      	at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) ~[xercesImpl.jar:2.12.0]
      	at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source) ~[xercesImpl.jar:2.12.0]
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl.jar:?]
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl.jar:?]
      	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) ~[xercesImpl.jar:?]
      	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) ~[xercesImpl.jar:?]
      	at com.liferay.portal.security.xml.StripDoctypeXMLReader.parse(StripDoctypeXMLReader.java:138) ~[portal-impl.jar:?]
      	at org.dom4j.io.SAXReader.read(SAXReader.java:494) ~[dom4j.jar:?]
      	at org.dom4j.io.SAXReader.read(SAXReader.java:392) ~[dom4j.jar:?]
      	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:368) ~[portal-impl.jar:?]
      	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:346) ~[portal-impl.jar:?]
      	at com.liferay.portal.kernel.xml.UnsecureSAXReaderUtil.read(UnsecureSAXReaderUtil.java:46) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.MVCCVersionUpgradeProcess.getClassElements(MVCCVersionUpgradeProcess.java:98) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.MVCCVersionUpgradeProcess.upgradeClassElementMVCCVersions(MVCCVersionUpgradeProcess.java:117) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.MVCCVersionUpgradeProcess.doUpgrade(MVCCVersionUpgradeProcess.java:86) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.lambda$upgrade$0(UpgradeProcess.java:114) ~[portal-kernel.jar:?]
      	at com.liferay.portal.db.partition.DBPartitionUtil.forEachCompanyId(DBPartitionUtil.java:113) ~[portal-impl.jar:?]
      	at com.liferay.portal.dao.db.BaseDB.process(BaseDB.java:307) ~[portal-impl.jar:?]
      	at com.liferay.portal.kernel.dao.db.BaseDBProcess.process(BaseDBProcess.java:241) ~[portal-kernel.jar:?]
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:101) ~[portal-kernel.jar:?]
      	... 23 more
      

      Root cause analysis

      Likely caused by LPS-105380 bringing back MVCCVersionUpgradeProcess.java, previously in portal-impl, to portal-kernel. The method com.liferay.portal.kernel.upgrade.MVCCVersionUpgradeProcess.getClassElements() assumes there's a portal-hbm.xml file accessible to the classloader, but this is not always the case, as portal-hbm.xml is only present in the portal-impl module.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              team-uniform Product Team Uniform
              Reporter:
              cleydyr.albuquerque Cleydyr Albuquerque (Inactive)
              Participants of an Issue:
              Recent user:
              Felipe Lins
              Engineering Assignee:
              Cleydyr Albuquerque (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                26 weeks, 3 days ago

                  Packages

                  Version Package
                  7.4.3.6 CE GA6
                  7.4.13 DXP U2
                  7.4.3.22 CE GA22
                  Master