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

UpgradeDynamicDataMapping does not tolerate a mid-upgrade failure

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Won't Fix
    • Affects Version/s: 7.0.X EE, Master
    • Fix Version/s: None
    • Labels:
      None
    • Fix Priority:
      3

      Description

      Description
      As of Liferay DXP, we have separated our upgrade processes into core upgrade processes and module upgrade processes. A failure during the core upgrade process will immediately terminate the upgrade process and leave the database in an unusable state, forcing the user to revert to a backup and retry the upgrade. However, a failure during a module upgrade process will not stop the upgrade process. The full upgrade process can complete successfully even if some module upgrade processes have failed.

      In light of this, it is important to make sure that if a module upgrade process fails, it does not leave that module in a permanently unusable state. The user should be given an opportunity to fix whatever problem caused the upgrade failure and retry the module upgrade.

      Unfortunately, the UpgradeDynamicDataMapping class was not written with this principle in mind. If you experience a failure during a certain part of the UpgradeDynamicDataMapping process, you will find that all your DDMStructure definitions have been turned into JSON, yet the storageType claims they are "xml". Moreover, the upgrade process assumes that your DDMStructure definitions are all going to be stored as XML when you start the upgrade, so if you rerun the upgrade, it will try to parse them as XML and immediately fail.

      We will need to rewrite this class so that it (1) does not assume that the user has not tried to run this Upgrade process already and (2) updates all fields at the logically correct time to do so, so that the database doesn't potentially get stuck in an inconsistent state (such as having fields stored as JSON but claiming they are stored as XML).

      Steps to Reproduce

      1. Start up Liferay 6.2 on a fresh database and log in as the admin user
      2. Navigate to Admin > Site Administration > Content > Dynamic Data Lists > Add
      3. Fill out the required fields. You can select any Data Definition or even make a new one if you want. Save your list.
      4. Click on the List that you just added, and click on "Add [Data Definition Name]"
      5. Shut down Liferay
      6. Run select xml from DDMContent on your database. You should have a single record of xml. Copy this xml and store it somewhere to be used later.
      7. Run update DDMContent set xml = 'blah' on your database. This will cause the UpgradeDynamicDataMapping process to fail later on.
      8. On the version of Liferay you are testing on, configure the upgrade tool to point to the database you are using.
      9. Run the upgrade tool. The upgrade process should complete successfully; however, you should see the following error in the logs:
        21:19:09,594 ERROR [main][com_liferay_portal_upgrade:97] Invocation to listener threw exception
        java.lang.RuntimeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog
                at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfosRunnable.run(ReleaseManagerOSGiCommands.java:491)
                at com.liferay.portal.output.stream.container.OutputStreamContainerFactoryTracker.runWithSwappedLog(OutputStreamContainerFactoryTracker.java:100)
                at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.executeUpgradeInfos(ReleaseManagerOSGiCommands.java:295)
                at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.doExecute(ReleaseManagerOSGiCommands.java:251)
                at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfoServiceTrackerMapListener.keyEmitted(ReleaseManagerOSGiCommands.java:441)
                at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfoServiceTrackerMapListener.keyEmitted(ReleaseManagerOSGiCommands.java:431)
                at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$DefaultEmitter.emit(ServiceTrackerMapImpl.java:222)
                at com.liferay.osgi.service.tracker.collections.map.PropertyServiceReferenceMapper.map(PropertyServiceReferenceMapper.java:43)
                at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$ServiceReferenceServiceTrackerCustomizer.addingService(ServiceTrackerMapImpl.java:261)
                at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$ServiceReferenceServiceTrackerCustomizer.addingService(ServiceTrackerMapImpl.java:248)
                at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
                at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
                at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
                at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
                at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318)
                at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)
                at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl.open(ServiceTrackerMapImpl.java:94)
                at com.liferay.osgi.service.tracker.collections.map.ServiceTrackerMapFactory.openMultiValueMap(ServiceTrackerMapFactory.java:244)
                at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.activate(ReleaseManagerOSGiCommands.java:214)
                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:497)
                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.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:1012)
                at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:968)
                at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215)
                at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136)
                at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945)
                at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881)
                at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167)
                at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127)
                at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
                at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:917)
                at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
                at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
                at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
                at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
                at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
                at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
                at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
                at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:886)
                at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:873)
                at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132)
                at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:940)
                at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:740)
                at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:1012)
                at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:968)
                at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215)
                at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136)
                at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945)
                at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881)
                at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167)
                at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127)
                at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
                at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:917)
                at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
                at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
                at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
                at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
                at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
                at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
                at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
                at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:482)
                at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:1001)
                at com.liferay.registry.internal.RegistryImpl.registerService(RegistryImpl.java:305)
                at com.liferay.portal.tools.DBUpgrader._registerModuleServiceLifecycle(DBUpgrader.java:410)
                at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:106)
        Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
                at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:93)
                at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:124)
                at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfosRunnable.run(ReleaseManagerOSGiCommands.java:470)
                ... 77 more
        Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
                at com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping$DDMFormValuesXSDDeserializer.deserialize(UpgradeDynamicDataMapping.java:1674)
                at com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping.getDDMFormValues(UpgradeDynamicDataMapping.java:366)
                at com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping.upgradeXMLStorageAdapter(UpgradeDynamicDataMapping.java:1437)
                at com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping.doUpgrade(UpgradeDynamicDataMapping.java:255)
                at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:90)
                ... 79 more
        Caused by: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
                at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:410)
                at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:386)
                at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:421)
                at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUtil.java:165)
                at com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping$DDMFormValuesXSDDeserializer.deserialize(UpgradeDynamicDataMapping.java:1644)
                ... 83 more
        Caused by: org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
                at org.dom4j.io.SAXReader.read(SAXReader.java:482)
                at org.dom4j.io.SAXReader.read(SAXReader.java:365)
                at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:407)
                ... 87 more
        

        This error is to be expected because of what you did in step 7. This is saying that the UpgradeDynamicDataMapping process failed mid-upgrade.

      10. Now run update DDMContent set xml = '[THE XML YOU COPIED IN STEP 6]' on your database (replacing "[THE XML YOU COPIED IN STEP 6]" with the actual xml that you copied in step 6).
      11. Start up the portal and observe the logs during the UpgradeDynamicDataMapping process.

      Expected Result: Since you have fixed your data problem, the UpgradeDynamicDataMapping process should now complete successfully with no errors.
      Actual Result: The UpgradeDynamicDataMapping Process fails with a different error than before:

      21:25:43,863 ERROR [localhost-startStop-1][com_liferay_portal_upgrade:97] Invocation to listener threw exception
      java.lang.RuntimeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.exception.PortalException: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
              at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfosRunnable.run(ReleaseManagerOSGiCommands.java:491)
              at com.liferay.portal.output.stream.container.OutputStreamContainerFactoryTracker.runWithSwappedLog(OutputStreamContainerFactoryTracker.java:100)
              at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.executeUpgradeInfos(ReleaseManagerOSGiCommands.java:295)
              at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.doExecute(ReleaseManagerOSGiCommands.java:251)
              at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfoServiceTrackerMapListener.keyEmitted(ReleaseManagerOSGiCommands.java:441)
              at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfoServiceTrackerMapListener.keyEmitted(ReleaseManagerOSGiCommands.java:431)
              at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$DefaultEmitter.emit(ServiceTrackerMapImpl.java:222)
              at com.liferay.osgi.service.tracker.collections.map.PropertyServiceReferenceMapper.map(PropertyServiceReferenceMapper.java:43)
              at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$ServiceReferenceServiceTrackerCustomizer.addingService(ServiceTrackerMapImpl.java:261)
              at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$ServiceReferenceServiceTrackerCustomizer.addingService(ServiceTrackerMapImpl.java:248)
              at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
              at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
              at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
              at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
              at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318)
              at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)
              at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl.open(ServiceTrackerMapImpl.java:94)
              at com.liferay.osgi.service.tracker.collections.map.ServiceTrackerMapFactory.openMultiValueMap(ServiceTrackerMapFactory.java:244)
              at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.activate(ReleaseManagerOSGiCommands.java:214)
              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:497)
              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.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:1012)
              at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:968)
              at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215)
              at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136)
              at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945)
              at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881)
              at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167)
              at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127)
              at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
              at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:917)
              at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
              at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
              at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
              at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:886)
              at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:873)
              at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132)
              at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:940)
              at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:740)
              at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:1012)
              at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:968)
              at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215)
              at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136)
              at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945)
              at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881)
              at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167)
              at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127)
              at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
              at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:917)
              at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
              at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
              at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
              at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
              at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:482)
              at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:1001)
              at com.liferay.registry.internal.RegistryImpl.registerService(RegistryImpl.java:305)
              at com.liferay.portal.servlet.MainServlet.registerPortalInitialized(MainServlet.java:1338)
              at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:424)
              at javax.servlet.GenericServlet.init(GenericServlet.java:158)
              at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1238)
              at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1151)
              at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1038)
              at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4997)
              at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5289)
              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
              at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:585)
              at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1794)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.exception.PortalException: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
              at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:93)
              at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:124)
              at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfosRunnable.run(ReleaseManagerOSGiCommands.java:470)
              ... 94 more
      Caused by: com.liferay.portal.kernel.exception.PortalException: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
              at com.liferay.dynamic.data.mapping.io.internal.DDMFormXSDDeserializerImpl.deserialize(DDMFormXSDDeserializerImpl.java:66)
              at com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping.getDDMForm(UpgradeDynamicDataMapping.java:301)
              at com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping.upgradeStructuresAndAddStructureVersionsAndLayouts(UpgradeDynamicDataMapping.java:1159)
              at com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping.doUpgrade(UpgradeDynamicDataMapping.java:253)
              at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:90)
              ... 96 more
      Caused by: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
              at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:410)
              at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:386)
              at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:421)
              at com.liferay.dynamic.data.mapping.io.internal.DDMFormXSDDeserializerImpl.deserialize(DDMFormXSDDeserializerImpl.java:54)
              ... 100 more
      Caused by: org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
              at org.dom4j.io.SAXReader.read(SAXReader.java:482)
              at org.dom4j.io.SAXReader.read(SAXReader.java:365)
              at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:407)
              ... 103 more
      

      If you examine your DDMStructure table, you'll notice that all your DDMStructure's definition fields are stored as JSON, yet the storageType column for each of them says "xml".

      Reproduced in master (74b1a2def1879cd4239386e2d73c38c176d32003)
      Reproduced in ee-7.0.x (f18502eb716bc5a7f9933769fc87f3a55622ce7f)
      Not applicable to ee-6.2.x or earlier because there are no module upgrade processes in these versions of the portal.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael.bowerman Michael Bowerman (Inactive)
                Reporter:
                michael.bowerman Michael Bowerman (Inactive)
                Participants of an Issue:
                Recent user:
                Michael Bowerman (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 11 weeks, 5 days ago

                  Packages

                  Version Package