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

UpgradeDynamicDataMapping throws an exception when a field is to be renamed like an existing one

    Details

      Description

      An UpgradeException is thrown when it tries to automatically update a field name and it conflicts with an existent one.

       

      Steps to reproduce:

      1. Start a 6.2.x portal.
      2. Create a new structure.
      3. Add two fields to the new structure with the following names:
        1. "origin-Id"
        2. "originId"
      4. Stop the portal.
      5. Run the upgrade process pointing to the database used previously.

      Expected result : the upgrade process finishes with no errors.

      Current result : The following exception is thrown and you are forced to change the field's name manually:

      upgrade:execute com.liferay.dynamic.data.mapping.service
      INFO - Upgrading com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping
      INFO - Starting com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping#setUpClassNameIds
      INFO - Completed com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping#setUpClassNameIds in 0 ms
      INFO - Starting com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping#upgradeExpandoStorageAdapter
      INFO - Completed com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping#upgradeExpandoStorageAdapter in 1 ms
      INFO - Starting com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping#upgradeStructuresAndAddStructureVersionsAndLayouts
      INFO - Completed com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping#upgradeStructuresAndAddStructureVersionsAndLayouts in 93 ms
      INFO - Failed upgrade process com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping in 98ms
      java.lang.RuntimeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: Unable to automatically update field name "origin-Id" because it only contains invalid characters or the updated value "originId" conflicts with a previous field name
       at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfosRunnable.run(ReleaseManagerOSGiCommands.java:564)
       at com.liferay.portal.output.stream.container.internal.OutputStreamContainerFactoryTrackerImpl.runWithSwappedLog(OutputStreamContainerFactoryTrackerImpl.java:106)
       at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.executeUpgradeInfos(ReleaseManagerOSGiCommands.java:337)
       at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.doExecute(ReleaseManagerOSGiCommands.java:280)
       at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.execute(ReleaseManagerOSGiCommands.java:139)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
       at java.lang.reflect.Method.invoke(Method.java:508)
       at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
       at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
       at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
       at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
       at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
       at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
       at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
       at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
       at org.apache.felix.gogo.shell.Console.run(Console.java:62)
       at org.apache.felix.gogo.shell.Shell.console(Shell.java:203)
       at org.apache.felix.gogo.shell.Shell.gosh(Shell.java:128)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
       at java.lang.reflect.Method.invoke(Method.java:508)
       at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
       at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
       at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
       at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
       at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
       at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
       at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
       at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
       at org.eclipse.equinox.console.telnet.TelnetConnection.run(TelnetConnection.java:94)
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: Unable to automatically update field name "origin-Id" because it only contains invalid characters or the updated value "originId" conflicts with a previous field name
       at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:97)
       at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:129)
       at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfosRunnable.run(ReleaseManagerOSGiCommands.java:539)
       ... 32 more
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: Unable to automatically update field name "origin-Id" because it only contains invalid characters or the updated value "originId" conflicts with a previous field name
       at com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping.createNewDDMFormFieldName(UpgradeDynamicDataMapping.java:214)
       at com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping.updateDDMFormFields(UpgradeDynamicDataMapping.java:671)
       at com.liferay.dynamic.data.mapping.internal.upgrade.v1_0_0.UpgradeDynamicDataMapping.upgradeStructuresAndAddStructureVersionsAndLayouts(UpgradeDynamicDataMapping.java:1161)
       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:92)
       ... 34 more

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 4 weeks, 1 day ago

                Packages

                Version Package
                7.0.0 DXP FP59
                7.0.0 DXP SP9
                7.0.X
                7.1.10 DXP FP3
                7.1.1 CE GA2
                7.1.10.1 SP1
                7.1.X
                Master