Uploaded image for project: 'PUBLIC - Liferay Portal Enterprise Edition'
  1. PUBLIC - Liferay Portal Enterprise Edition
  2. LPE-14733

StructureDuplicateStructureKeyException throw when import Dynamic Data Lists portlet

    Details

    • Business Value:
      3

      Description

      Description: When the same structureKey of DDMStructure table existed in two sites, if you export one site's structure and then import it into another site, the import will fail.

      Reproduction Steps:
      1.Change autogenerate.structure.key.description=false in DDMWebConfiguration class on master. (On 6.2.x, set dynamic.data.mapping.structure.force.autogenerate.key=false in portal-ext.properties.)
      2. Go to Liferay site->Dynamic Data Lists->Manage Data Definitions->Add.
      3. Enter "HAI" in Data Definition Key field and then save it.
      4. Export Dynamic Data Lists portlet as Dynamic_Data_Lists.lar
      5. Create one new site "ImportTargetSite".
      6. Go to "ImportTargetSite">Dynamic Data Lists>Manage Data Definitions->Add.
      7. Enter "HAI" in Data Definition Key field and then save it.
      8. Import the Dynamic_Data_Lists.lar into "ImportTargetSite".

      Actual behavior: Import failed. The below error thrown.

      07:54:53,855 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:156] Unable to execute background task
      com.liferay.portlet.exportimport.lar.PortletDataException: com.liferay.dynamic.data.mapping.exception.StructureDuplicateStructureKeyException
              at com.liferay.portlet.exportimport.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:394)
              at com.liferay.portlet.exportimport.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:367)
              at com.liferay.portlet.exportimport.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:353)
              at com.liferay.dynamic.data.lists.web.lar.DDLPortletDataHandler.doImportData(DDLPortletDataHandler.java:180)
              at com.liferay.portlet.exportimport.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:372)
              at com.liferay.exportimport.controller.PortletImportController.importPortletData(PortletImportController.java:312)
              at com.liferay.exportimport.controller.PortletImportController.importPortletData(PortletImportController.java:809)
              at com.liferay.exportimport.controller.PortletImportController.doImportPortletInfo(PortletImportController.java:602)
              at com.liferay.exportimport.controller.PortletImportController.importFile(PortletImportController.java:228)
              at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importPortletInfo(ExportImportLocalServiceImpl.java:373)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:153)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:84)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:173)
              at com.sun.proxy.$Proxy91.importPortletInfo(Unknown Source)
              at com.liferay.portlet.exportimport.service.ExportImportLocalServiceUtil.importPortletInfo(ExportImportLocalServiceUtil.java:162)
              at com.liferay.exportimport.background.task.PortletImportBackgroundTaskExecutor$PortletImportCallable.call(PortletImportBackgroundTaskExecutor.java:124)
              at com.liferay.exportimport.background.task.PortletImportBackgroundTaskExecutor$PortletImportCallable.call(PortletImportBackgroundTaskExecutor.java:110)
              at com.liferay.portal.spring.transaction.TransactionInvokerImpl$CallableMethodInvocation.proceed(TransactionInvokerImpl.java:113)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:84)
              at com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:41)
              at com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28)
              at com.liferay.exportimport.background.task.PortletImportBackgroundTaskExecutor.execute(PortletImportBackgroundTaskExecutor.java:85)
              at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:58)
              at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:43)
              at com.liferay.portal.kernel.backgroundtask.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:56)
              at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:121)
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
              at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
              at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:52)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:756)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: com.liferay.dynamic.data.mapping.exception.StructureDuplicateStructureKeyException
              at com.liferay.dynamic.data.mapping.service.impl.DDMStructureLocalServiceImpl.validate(DDMStructureLocalServiceImpl.java:1679)
              at com.liferay.dynamic.data.mapping.service.impl.DDMStructureLocalServiceImpl.addStructure(DDMStructureLocalServiceImpl.java:126)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:153)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:84)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
              at com.liferay.portal.service.ServiceContextAdvice.invoke(ServiceContextAdvice.java:38)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:173)
              at com.sun.proxy.$Proxy375.addStructure(Unknown Source)
              at com.liferay.dynamic.data.mapping.web.lar.DDMStructureStagedModelDataHandler.doImportStagedModel(DDMStructureStagedModelDataHandler.java:310)
              at com.liferay.dynamic.data.mapping.web.lar.DDMStructureStagedModelDataHandler.doImportStagedModel(DDMStructureStagedModelDataHandler.java:60)
              at com.liferay.portlet.exportimport.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:364)
              ... 37 more
      

      Expected behavior: Import successful.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gregory.bretall Gregory Bretall (Inactive)
              Reporter:
              hai.yu Hai Yu
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  6.2.X EE