-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.0.X, Master
-
Fix Version/s: 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
-
Component/s: Dynamic Data Mapping > Upgrades
-
Branch Version/s:7.1.x, 7.0.x
-
Backported to Branch:Committed
-
Story Points:1
-
Git Pull Request:
An UpgradeException is thrown when it tries to automatically update a field name and it conflicts with an existent one.
Steps to reproduce:
- Start a 6.2.x portal.
- Create a new structure.
- Add two fields to the new structure with the following names:
- "origin-Id"
- "originId"
- Stop the portal.
- 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