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

Issues with importing DDLRecords when structure is not present

    Details

      Description

      If a LAR with DDLRecords is imported into a site where the DDMStructure they are based on is not present (i.e., a LAR import from a different instance of Liferay), then after a few imports, the import will fail with a stack trace. In the database, the _fieldsDisplay element loses its value after the second import.

      Steps to reproduce:
      1. Create a new site
      2. Within the new site, create a DDMStructure with at least one field of any data type
      3. Create a Dynamic Data List and DDLRecord based on this structure
      4. Go to Site Pages -> Export as LAR
      5. Delete the Dynamic Data List (necessary to delete the site, because of the existing issue LPS-69573 in ee-6.2.x)
      6. Delete the site
      7. Create a new blank site
      8. Go to Site Pages -> Import the LAR three times

      Expected result: all three imports will be successful
      Actual result: the third import fails, with a stack trace

      Reproduced in ee-6.2.x: a12d6f47a07cd25753b224756b6167ca691d4f42
      Not reproduced in master: 00b3ef7cf1fa10e6efbc8458479d1e633942e77b

      Stack trace is as shown:

      23:29:54,861 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:133] Unable to execute background task
      com.liferay.portal.kernel.lar.PortletDataException: java.lang.NullPointerException
      	at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:175)
      	at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:340)
      	at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:330)
      	at com.liferay.portlet.dynamicdatalists.lar.DDLPortletDataHandler.doImportData(DDLPortletDataHandler.java:194)
      	at com.liferay.portal.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:327)
      	at com.liferay.portal.lar.PortletImporter.importPortletData(PortletImporter.java:191)
      	at com.liferay.portal.lar.PortletImporter.importPortletData(PortletImporter.java:1028)
      	at com.liferay.portal.lar.LayoutImporter.doImportLayouts(LayoutImporter.java:803)
      	at com.liferay.portal.lar.LayoutImporter.importLayouts(LayoutImporter.java:249)
      	at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importLayouts(LayoutLocalServiceImpl.java:1763)
      	at com.liferay.portal.service.impl.LayoutLocalServiceImpl.importLayouts(LayoutLocalServiceImpl.java:1812)
      	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:498)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
      	at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:182)
      	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 com.sun.proxy.$Proxy36.importLayouts(Unknown Source)
      	at com.liferay.portal.service.LayoutLocalServiceUtil.importLayouts(LayoutLocalServiceUtil.java:1308)
      	at com.liferay.portal.lar.backgroundtask.LayoutImportBackgroundTaskExecutor.execute(LayoutImportBackgroundTaskExecutor.java:61)
      	at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:57)
      	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:71)
      	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:745)
      Caused by: java.lang.NullPointerException
      	at com.liferay.portlet.dynamicdatamapping.util.DDMImpl.splitFieldsDisplayValue(DDMImpl.java:422)
      	at com.liferay.portlet.dynamicdatamapping.util.DDMImpl.mergeFields(DDMImpl.java:373)
      	at com.liferay.portlet.dynamicdatamapping.util.DDMUtil.mergeFields(DDMUtil.java:111)
      	at com.liferay.portlet.dynamicdatalists.service.impl.DDLRecordLocalServiceImpl.updateRecord(DDLRecordLocalServiceImpl.java:504)
      	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:498)
      	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 com.sun.proxy.$Proxy290.updateRecord(Unknown Source)
      	at com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalServiceUtil.updateRecord(DDLRecordLocalServiceUtil.java:543)
      	at com.liferay.portlet.dynamicdatalists.lar.DDLRecordStagedModelDataHandler.doImportStagedModel(DDLRecordStagedModelDataHandler.java:138)
      	at com.liferay.portlet.dynamicdatalists.lar.DDLRecordStagedModelDataHandler.doImportStagedModel(DDLRecordStagedModelDataHandler.java:1)
      	at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:164)
      	... 34 more

        Attachments

        1. 69595_2.png
          69595_2.png
          22 kB
        2. 69595.png
          69595.png
          52 kB

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 48 weeks ago

                  Packages

                  Version Package
                  6.2.X EE