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

NullPointerException when importing WC Articles with 'ddm-separator' fields

    Details

      Description

      Description

      When importing Web Content containing DDM-Separator fields, we get a NullPointerException

      Steps to reproduce

      1. Start a Liferay DXP 7.1 instance
      2. Create a new Site called "Exported Site".
      3. Go to Content > Web Content
      4. Create a new Structure called "Exported Structure".
      5. Drop in a "Separator" field.
        • Label: SeparatorField
        • Repeatable: Yes.
      6. Drop in a "Text" field inside the "SeparatorField".
        • Label: TextField
      7. Save.
      8. Create a new Template called "Exported Template".
        • Choose "Exported Structure" for Structure.
        • Click "Save".
      9. Create a new Article based on "Exported Structure" called "Exported Article".
        • Add a group of "SeparatorField" so that there are two.
        • Enter in any values for the two "TextField" fields.
      10. Click "Publish".
      11. At the top three dots, click "Export / Import".
        • Ensure that "Content > All " is selected for export.
      12. Click "Export".
      13. When finished, download the built .LAR file.
      14. Create a new Site called "Imported Site".
      15. Go to "Content > Web Content"
      16. At the top three dots, click "Export / Import".
      17. Import the .LAR file you created in step 11 with the default import settings

       Expected
      The Structures, Templates and Articles import correctly.
       Actual
      An error message is outputted in the UI along with the following error in the logs

      2018-10-19 17:06:36.462 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:168] Unable to execute background task
      com.liferay.exportimport.kernel.lar.PortletDataException
       ... 
      Caused by: java.lang.NullPointerException
      	at com.liferay.journal.internal.exportimport.content.processor.JournalArticleExportImportContentProcessor._fetchContentsFromDDMFormValues(JournalArticleExportImportContentProcessor.java:530)
      
      

      Master
      Reproduced - bc1b6624e1f20d7f215283372f40d64d30be3f2c
      Branch
      Reproduced - b9bf75b2a0b26d6523c686496105330322680016

      Other steps to reproduce it:

      1. Create an WC structure with a separator field
      2. Create a WC template for that structure
      3. Create a web content with that structure
      4. Enabling staging for that site

      You will get this exception:

      2018-11-02 13:45:16.828 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:168] Unable to execute background task
      com.liferay.exportimport.kernel.lar.PortletDataException
              at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:433)
              at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:459)
              at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:445)
              at com.liferay.journal.internal.exportimport.data.handler.JournalPortletDataHandler.doImportData(JournalPortletDataHandler.java:383)
              at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:383)
              at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importPortletData(PortletImportControllerImpl.java:415)
              at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importPortletData(PortletImportControllerImpl.java:346)
              at com.liferay.site.internal.exportimport.data.handler.StagedGroupStagedModelDataHandler.importSitePortlets(StagedGroupStagedModelDataHandler.java:594)
              at com.liferay.site.internal.exportimport.data.handler.StagedGroupStagedModelDataHandler.doImportStagedModel(StagedGroupStagedModelDataHandler.java:319)
              at com.liferay.site.internal.exportimport.data.handler.StagedGroupStagedModelDataHandler.doImportStagedModel(StagedGroupStagedModelDataHandler.java:78)
              at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:392)
              at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:459)
              at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:445)
              at com.liferay.exportimport.internal.controller.LayoutImportController.doImportFile(LayoutImportController.java:580)
              at com.liferay.exportimport.internal.controller.LayoutImportController.importFile(LayoutImportController.java:220)
              at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importLayouts(ExportImportLocalServiceImpl.java:218)
              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:156)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:133)
              at com.liferay.portal.spring.aop.RetryAdvice.invoke(RetryAdvice.java:47)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:133)
              at com.liferay.portal.service.ServiceContextAdvice.invoke(ServiceContextAdvice.java:39)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:133)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:133)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:133)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:133)
              at com.liferay.portal.cache.thread.local.ThreadLocalCacheAdvice.invoke(ThreadLocalCacheAdvice.java:48)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:133)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:133)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:133)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:133)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:133)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:133)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:139)
              at com.sun.proxy.$Proxy156.importLayouts(Unknown Source)
              at com.liferay.exportimport.kernel.service.ExportImportLocalServiceUtil.importLayouts(ExportImportLocalServiceUtil.java:112)
              at com.liferay.exportimport.internal.background.task.LayoutStagingBackgroundTaskExecutor$LayoutStagingImportCallable.call(LayoutStagingBackgroundTaskExecutor.java:285)
              at com.liferay.exportimport.internal.background.task.LayoutStagingBackgroundTaskExecutor$LayoutStagingImportCallable.call(LayoutStagingBackgroundTaskExecutor.java:258)
              at com.liferay.portal.spring.transaction.TransactionInvokerImpl$CallableMethodInvocation.proceed(TransactionInvokerImpl.java:101)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
              at com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:47)
              at com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28)
              at com.liferay.exportimport.internal.background.task.LayoutStagingBackgroundTaskExecutor.execute(LayoutStagingBackgroundTaskExecutor.java:145)
              at com.liferay.portal.background.task.internal.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:62)
              at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:43)
              at com.liferay.portal.background.task.internal.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:75)
              at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:127)
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
              at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
              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:748)
      Caused by: java.lang.NullPointerException
              at com.liferay.journal.internal.exportimport.content.processor.JournalArticleExportImportContentProcessor._fetchContentsFromDDMFormValues(JournalArticleExportImportContentProcessor.java:530)
              at com.liferay.journal.internal.exportimport.content.processor.JournalArticleExportImportContentProcessor.replaceImportContentReferences(JournalArticleExportImportContentProcessor.java:146)
              at com.liferay.journal.internal.exportimport.content.processor.JournalArticleExportImportContentProcessor.replaceImportContentReferences(JournalArticleExportImportContentProcessor.java:69)
              at com.liferay.adaptive.media.journal.web.internal.exportimport.content.processor.AMJournalArticleExportImportContentProcessor.replaceImportContentReferences(AMJournalArticleExportImportContentProcessor.java:66)
              at com.liferay.adaptive.media.journal.web.internal.exportimport.content.processor.AMJournalArticleExportImportContentProcessor.replaceImportContentReferences(AMJournalArticleExportImportContentProcessor.java:28)
              at com.liferay.journal.internal.exportimport.data.handler.JournalArticleStagedModelDataHandler.doImportStagedModel(JournalArticleStagedModelDataHandler.java:577)
              at com.liferay.journal.internal.exportimport.data.handler.JournalArticleStagedModelDataHandler.doImportStagedModel(JournalArticleStagedModelDataHandler.java:103)
              at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:392)
              ... 65 more
      

        Attachments

          Activity

            People

            • Assignee:
              summer.zhang Summer Zhang
              Reporter:
              alfred.sampang Alfred Sampang
              Participants of an Issue:
              Recent user:
              Csaba Turcsan
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                49 weeks, 4 days ago

                Packages

                Version Package
                7.1.10 DXP FP4
                7.1.10.1 SP1
                7.1.2 CE GA3
                7.1.X
                Master