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

If a custom document type contains one of the default metadata sets, it fails to import

    Details

      Description

      steps to reproduce
      1) navigate to document library and create a custom document type.
      2) when creating the document type, select an additional metadata set
      3) choose one of the default metadata sets such as "Meeting Metadata"
      4) upload a document using the newly created type
      5) export the documents and media library
      6) download the lar and them import the lar (to either a different site or the same, it doesn't matter)
      7) the import fails.

      expected behavior: the import succeeds without error
      actual behavior: the import fails with a stacktrace

      tested on liferay-portal git Id aa576b9a84a6f5d8a7debd8a80aabb8775d333fd

      the problem seems to be that the groupId being set during the export is for Global but that reference never seems to be written into the lar
      PortletDataContextImpl.getReferenceDataElements:2361

      stacktrace:

      19:15:20,989 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:92] Unable to execute background task
      com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portlet.dynamicdatamapping.NoSuchStructureException: No DDMStructure exists with the primary key 0
              at com.liferay.portal.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:328)
              at com.liferay.portal.lar.PortletImporter.importPortletData(PortletImporter.java:190)
              at com.liferay.portal.lar.PortletImporter.importPortletData(PortletImporter.java:1008)
              at com.liferay.portal.lar.PortletImporter.doImportPortletInfo(PortletImporter.java:569)
              at com.liferay.portal.lar.PortletImporter.importPortletInfo(PortletImporter.java:209)
              at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importPortletInfo(LayoutLocalServiceImpl.java:1888)
              at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importPortletInfo(LayoutLocalServiceImpl.java:1956)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
              at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:179)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice.invoke(LayoutLocalServiceStagingAdvice.java:141)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
              at $Proxy31.importPortletInfo(Unknown Source)
              at com.liferay.portal.service.LayoutLocalServiceUtil.importPortletInfo(LayoutLocalServiceUtil.java:1382)
              at com.liferay.portal.lar.backgroundtask.PortletImportBackgroundTaskExecutor.execute(PortletImportBackgroundTaskExecutor.java:61)
              at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:56)
              at com.liferay.portal.backgroundtask.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:108)
              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:69)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
              at java.lang.Thread.run(Thread.java:619)
      Caused by: com.liferay.portal.kernel.lar.PortletDataException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portlet.dynamicdatamapping.NoSuchStructureException: No DDMStructure exists with the primary key 0
              at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:125)
              at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:209)
              at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:199)
              at com.liferay.portlet.documentlibrary.lar.DLPortletDataHandler.doImportData(DLPortletDataHandler.java:186)
              at com.liferay.portal.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:324)
              ... 30 more
      Caused by: com.liferay.portal.kernel.exception.SystemException: com.liferay.portlet.dynamicdatamapping.NoSuchStructureException: No DDMStructure exists with the primary key 0
              at com.liferay.portal.service.persistence.impl.TableMapperImpl.getBaseModels(TableMapperImpl.java:404)
              at com.liferay.portal.service.persistence.impl.TableMapperImpl.getLeftBaseModels(TableMapperImpl.java:241)
              at com.liferay.portal.service.persistence.impl.ReverseTableMapper.getRightBaseModels(ReverseTableMapper.java:96)
              at com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryTypePersistenceImpl.getDDMStructures(DLFileEntryTypePersistenceImpl.java:4097)
              at com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryTypePersistenceImpl.getDDMStructures(DLFileEntryTypePersistenceImpl.java:4076)
              at com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryTypePersistenceImpl.getDDMStructures(DLFileEntryTypePersistenceImpl.java:4057)
              at com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureLocalServiceImpl.getDLFileEntryTypeStructures(DDMStructureLocalServiceImpl.java:712)
              at sun.reflect.GeneratedMethodAccessor1045.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
              at $Proxy211.getDLFileEntryTypeStructures(Unknown Source)
              at com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil.getDLFileEntryTypeStructures(DDMStructureLocalServiceUtil.java:929)
              at com.liferay.portlet.documentlibrary.model.impl.DLFileEntryTypeImpl.getDDMStructures(DLFileEntryTypeImpl.java:37)
              at com.liferay.portlet.documentlibrary.lar.DLFileEntryTypeStagedModelDataHandler.doImportStagedModel(DLFileEntryTypeStagedModelDataHandler.java:205)
              at com.liferay.portlet.documentlibrary.lar.DLFileEntryTypeStagedModelDataHandler.doImportStagedModel(DLFileEntryTypeStagedModelDataHandler.java:1)
              at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:119)
              ... 34 more
      Caused by: com.liferay.portlet.dynamicdatamapping.NoSuchStructureException: No DDMStructure exists with the primary key 0
              at com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistenceImpl.findByPrimaryKey(DDMStructurePersistenceImpl.java:9230)
              at com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistenceImpl.findByPrimaryKey(DDMStructurePersistenceImpl.java:1)
              at com.liferay.portal.service.persistence.impl.TableMapperImpl.getBaseModels(TableMapperImpl.java:400)
              ... 54 more
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 13 weeks, 5 days ago

                  Packages

                  Version Package
                  6.2.0 CE RC6