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

PortletDataException occurs when importing circular reference

    Description

    Reproduction Steps:
    1) Create a page P1.
    2) Create a child page for P1, called P2.
    3) Create a child page for P2, called P3.
    4) Create a Web Content structure which has a link to a page element.
    5) Create a Template for this structure.
    6) Create a Journal Article: J1, its link-to-layout field points to P2.
    7) Create a Journal Article: J2, its link-to-layout field points to P3.
    8) Put a Web Content Display portlet to P1 and set Web Content to J2.
    9) Export the whole site.
    10) Create a new site and try to import the lar.

    Expected Result: Import process should be successful without any error.

    Actual Result: An unexpected error occurred with the publication process.

    2020-02-26 04:42:47.435 ERROR [liferay/background_task-8][BackgroundTaskMessageListener:182] Unable to execute background task
    com.liferay.exportimport.kernel.lar.PortletDataException: com.liferay.portal.kernel.dao.orm.ORMException: {"classNameId":"0","classPK":"0","colorSchemeId":"","companyId":"20097","createDate":1582691178280,"css":"","ctCollectionId":"0","description":"","descriptionCurrentValue":"","friendlyURL":"\/p1","groupId":"36102","hidden":false,"iconImageId":"0","keywords":"","keywordsCurrentValue":"","lastPublishDate":null,"layoutId":"2","layoutPrototypeLinkEnabled":false,"layoutPrototypeUuid":"","masterLayoutPlid":"0","modifiedDate":1582692167211,"mvccVersion":"3","name":"<?xml version='1.0' encoding='UTF-8'?><root available-locales=\"en_US\" default-locale=\"en_US\"><Name language-id=\"en_US\">P1<\/Name><\/root>","nameCurrentValue":"P1","parentLayoutId":"0","parentPlid":"0","plid":"21","priority":0,"privateLayout":false,"publishDate":null,"robots":"","robotsCurrentValue":"","sourcePrototypeLayoutUuid":"","status":0,"statusByUserId":"0","statusByUserName":"","statusDate":null,"system":false,"themeId":"classic_WAR_classictheme","title":"","titleCurrentValue":"","type":"portlet","typeSettings":"CUSTOMIZABLE_LAYOUT=false\ncolumn-1=com_liferay_journal_content_web_portlet_JournalContentPortlet_INSTANCE_LVzn2LVOpN5K\ncolumn-1-customizable=false\ncolumn-2-customizable=false\nlayout-template-id=2_columns_ii\nlayoutUpdateable=true\n","userId":"20127","userName":"","uuid":"27ba3f04-1b5d-a086-508f-93bf2c6e6018"} is stale in comparison to {"classNameId":"0","classPK":"0","colorSchemeId":"","companyId":"20097","createDate":1582691178280,"css":"","ctCollectionId":"0","description":"","descriptionCurrentValue":"","friendlyURL":"\/p1","groupId":"36102","hidden":false,"iconImageId":"0","keywords":"","keywordsCurrentValue":"","lastPublishDate":null,"layoutId":"2","layoutPrototypeLinkEnabled":false,"layoutPrototypeUuid":"","masterLayoutPlid":"0","modifiedDate":1582692167378,"mvccVersion":"5","name":"<?xml version='1.0' encoding='UTF-8'?><root available-locales=\"en_US\" default-locale=\"en_US\"><Name language-id=\"en_US\">P1<\/Name><\/root>","nameCurrentValue":"P1","parentLayoutId":"0","parentPlid":"0","plid":"21","priority":0,"privateLayout":false,"publishDate":null,"robots":"","robotsCurrentValue":"","sourcePrototypeLayoutUuid":"","status":0,"statusByUserId":"0","statusByUserName":"","statusDate":null,"system":false,"themeId":"classic_WAR_classictheme","title":"","titleCurrentValue":"","type":"portlet","typeSettings":"CUSTOMIZABLE_LAYOUT=false\ncolumn-1=com_liferay_journal_content_web_portlet_JournalContentPortlet_INSTANCE_LVzn2LVOpN5K\ncolumn-1-customizable=false\ncolumn-2-customizable=false\nlayout-template-id=2_columns_ii\nlayoutUpdateable=true\n","userId":"20127","userName":"","uuid":"27ba3f04-1b5d-a086-508f-93bf2c6e6018"}
            at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:408)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:355)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:341)
            at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doImportStagedModel(LayoutStagedModelDataHandler.java:733)
            at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doImportStagedModel(LayoutStagedModelDataHandler.java:138)
            at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:367)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:355)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:341)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.doImportReferenceStagedModel(StagedModelDataHandlerUtil.java:412)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importReferenceStagedModel(StagedModelDataHandlerUtil.java:270)
            at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importReferenceStagedModels(BaseStagedModelDataHandler.java:859)
            at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:365)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:355)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:341)
            at com.liferay.journal.internal.exportimport.data.handler.JournalPortletDataHandler.doImportData(JournalPortletDataHandler.java:392)
            at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:390)
            at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importPortletData(PortletImportControllerImpl.java:409)
            at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importPortletData(PortletImportControllerImpl.java:340)
            at com.liferay.site.internal.exportimport.data.handler.StagedGroupStagedModelDataHandler.importSitePortlets(StagedGroupStagedModelDataHandler.java:599)
            at com.liferay.site.internal.exportimport.data.handler.StagedGroupStagedModelDataHandler.doImportStagedModel(StagedGroupStagedModelDataHandler.java:327)
            at com.liferay.site.internal.exportimport.data.handler.StagedGroupStagedModelDataHandler.doImportStagedModel(StagedGroupStagedModelDataHandler.java:78)
            at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:367)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:355)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:341)
            at com.liferay.exportimport.internal.controller.LayoutImportController.doImportFile(LayoutImportController.java:569)
            at com.liferay.exportimport.internal.controller.LayoutImportController.importFile(LayoutImportController.java:216)
            at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importLayouts(ExportImportLocalServiceImpl.java:195)
            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.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
            at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69)
            at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
            at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
            at com.sun.proxy.$Proxy96.importLayouts(Unknown Source)
            at com.liferay.exportimport.kernel.service.ExportImportLocalServiceUtil.importLayouts(ExportImportLocalServiceUtil.java:105)
            at com.liferay.exportimport.internal.background.task.LayoutImportBackgroundTaskExecutor$LayoutImportCallable.call(LayoutImportBackgroundTaskExecutor.java:133)
            at com.liferay.exportimport.internal.background.task.LayoutImportBackgroundTaskExecutor$LayoutImportCallable.call(LayoutImportBackgroundTaskExecutor.java:119)
            at com.liferay.portal.spring.transaction.BaseTransactionExecutor.execute(BaseTransactionExecutor.java:37)
            at com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:39)
            at com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28)
            at com.liferay.exportimport.internal.background.task.LayoutImportBackgroundTaskExecutor.execute(LayoutImportBackgroundTaskExecutor.java:85)
            at com.liferay.portal.background.task.internal.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:62)
            at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:41)
            at com.liferay.portal.background.task.internal.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:72)
            at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:136)
            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.messaging.internal.ParallelDestination$1.run(ParallelDestination.java:56)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
    Caused by: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: {"classNameId":"0","classPK":"0","colorSchemeId":"","companyId":"20097","createDate":1582691178280,"css":"","ctCollectionId":"0","description":"","descriptionCurrentValue":"","friendlyURL":"\/p1","groupId":"36102","hidden":false,"iconImageId":"0","keywords":"","keywordsCurrentValue":"","lastPublishDate":null,"layoutId":"2","layoutPrototypeLinkEnabled":false,"layoutPrototypeUuid":"","masterLayoutPlid":"0","modifiedDate":1582692167211,"mvccVersion":"3","name":"<?xml version='1.0' encoding='UTF-8'?><root available-locales=\"en_US\" default-locale=\"en_US\"><Name language-id=\"en_US\">P1<\/Name><\/root>","nameCurrentValue":"P1","parentLayoutId":"0","parentPlid":"0","plid":"21","priority":0,"privateLayout":false,"publishDate":null,"robots":"","robotsCurrentValue":"","sourcePrototypeLayoutUuid":"","status":0,"statusByUserId":"0","statusByUserName":"","statusDate":null,"system":false,"themeId":"classic_WAR_classictheme","title":"","titleCurrentValue":"","type":"portlet","typeSettings":"CUSTOMIZABLE_LAYOUT=false\ncolumn-1=com_liferay_journal_content_web_portlet_JournalContentPortlet_INSTANCE_LVzn2LVOpN5K\ncolumn-1-customizable=false\ncolumn-2-customizable=false\nlayout-template-id=2_columns_ii\nlayoutUpdateable=true\n","userId":"20127","userName":"","uuid":"27ba3f04-1b5d-a086-508f-93bf2c6e6018"} is stale in comparison to {"classNameId":"0","classPK":"0","colorSchemeId":"","companyId":"20097","createDate":1582691178280,"css":"","ctCollectionId":"0","description":"","descriptionCurrentValue":"","friendlyURL":"\/p1","groupId":"36102","hidden":false,"iconImageId":"0","keywords":"","keywordsCurrentValue":"","lastPublishDate":null,"layoutId":"2","layoutPrototypeLinkEnabled":false,"layoutPrototypeUuid":"","masterLayoutPlid":"0","modifiedDate":1582692167378,"mvccVersion":"5","name":"<?xml version='1.0' encoding='UTF-8'?><root available-locales=\"en_US\" default-locale=\"en_US\"><Name language-id=\"en_US\">P1<\/Name><\/root>","nameCurrentValue":"P1","parentLayoutId":"0","parentPlid":"0","plid":"21","priority":0,"privateLayout":false,"publishDate":null,"robots":"","robotsCurrentValue":"","sourcePrototypeLayoutUuid":"","status":0,"statusByUserId":"0","statusByUserName":"","statusDate":null,"system":false,"themeId":"classic_WAR_classictheme","title":"","titleCurrentValue":"","type":"portlet","typeSettings":"CUSTOMIZABLE_LAYOUT=false\ncolumn-1=com_liferay_journal_content_web_portlet_JournalContentPortlet_INSTANCE_LVzn2LVOpN5K\ncolumn-1-customizable=false\ncolumn-2-customizable=false\nlayout-template-id=2_columns_ii\nlayoutUpdateable=true\n","userId":"20127","userName":"","uuid":"27ba3f04-1b5d-a086-508f-93bf2c6e6018"}
            at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:445)
            at com.liferay.portal.service.persistence.impl.LayoutPersistenceImpl.updateImpl(LayoutPersistenceImpl.java:16092)
            at com.liferay.portal.service.persistence.impl.LayoutPersistenceImpl.updateImpl(LayoutPersistenceImpl.java:75)
            at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.update(BasePersistenceImpl.java:543)
            at com.liferay.portal.service.base.LayoutLocalServiceBaseImpl.updateLayout(LayoutLocalServiceBaseImpl.java:589)
            at sun.reflect.GeneratedMethodAccessor292.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice$LayoutLocalServiceStagingInvocationHandler._invoke(LayoutLocalServiceStagingAdvice.java:806)
            at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice$LayoutLocalServiceStagingInvocationHandler.invoke(LayoutLocalServiceStagingAdvice.java:785)
            at com.sun.proxy.$Proxy90.updateLayout(Unknown Source)
            at sun.reflect.GeneratedMethodAccessor292.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
            at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69)
            at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
            at com.liferay.portal.kernel.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:64)
            at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
            at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
            at com.sun.proxy.$Proxy90.updateLayout(Unknown Source)
            at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doImportStagedModel(LayoutStagedModelDataHandler.java:887)
            at com.liferay.layout.admin.web.internal.exportimport.data.handler.LayoutStagedModelDataHandler.doImportStagedModel(LayoutStagedModelDataHandler.java:138)
            at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:367)
            ... 52 more
    Caused by: com.liferay.portal.kernel.dao.orm.ORMException: {"classNameId":"0","classPK":"0","colorSchemeId":"","companyId":"20097","createDate":1582691178280,"css":"","ctCollectionId":"0","description":"","descriptionCurrentValue":"","friendlyURL":"\/p1","groupId":"36102","hidden":false,"iconImageId":"0","keywords":"","keywordsCurrentValue":"","lastPublishDate":null,"layoutId":"2","layoutPrototypeLinkEnabled":false,"layoutPrototypeUuid":"","masterLayoutPlid":"0","modifiedDate":1582692167211,"mvccVersion":"3","name":"<?xml version='1.0' encoding='UTF-8'?><root available-locales=\"en_US\" default-locale=\"en_US\"><Name language-id=\"en_US\">P1<\/Name><\/root>","nameCurrentValue":"P1","parentLayoutId":"0","parentPlid":"0","plid":"21","priority":0,"privateLayout":false,"publishDate":null,"robots":"","robotsCurrentValue":"","sourcePrototypeLayoutUuid":"","status":0,"statusByUserId":"0","statusByUserName":"","statusDate":null,"system":false,"themeId":"classic_WAR_classictheme","title":"","titleCurrentValue":"","type":"portlet","typeSettings":"CUSTOMIZABLE_LAYOUT=false\ncolumn-1=com_liferay_journal_content_web_portlet_JournalContentPortlet_INSTANCE_LVzn2LVOpN5K\ncolumn-1-customizable=false\ncolumn-2-customizable=false\nlayout-template-id=2_columns_ii\nlayoutUpdateable=true\n","userId":"20127","userName":"","uuid":"27ba3f04-1b5d-a086-508f-93bf2c6e6018"} is stale in comparison to {"classNameId":"0","classPK":"0","colorSchemeId":"","companyId":"20097","createDate":1582691178280,"css":"","ctCollectionId":"0","description":"","descriptionCurrentValue":"","friendlyURL":"\/p1","groupId":"36102","hidden":false,"iconImageId":"0","keywords":"","keywordsCurrentValue":"","lastPublishDate":null,"layoutId":"2","layoutPrototypeLinkEnabled":false,"layoutPrototypeUuid":"","masterLayoutPlid":"0","modifiedDate":1582692167378,"mvccVersion":"5","name":"<?xml version='1.0' encoding='UTF-8'?><root available-locales=\"en_US\" default-locale=\"en_US\"><Name language-id=\"en_US\">P1<\/Name><\/root>","nameCurrentValue":"P1","parentLayoutId":"0","parentPlid":"0","plid":"21","priority":0,"privateLayout":false,"publishDate":null,"robots":"","robotsCurrentValue":"","sourcePrototypeLayoutUuid":"","status":0,"statusByUserId":"0","statusByUserName":"","statusDate":null,"system":false,"themeId":"classic_WAR_classictheme","title":"","titleCurrentValue":"","type":"portlet","typeSettings":"CUSTOMIZABLE_LAYOUT=false\ncolumn-1=com_liferay_journal_content_web_portlet_JournalContentPortlet_INSTANCE_LVzn2LVOpN5K\ncolumn-1-customizable=false\ncolumn-2-customizable=false\nlayout-template-id=2_columns_ii\nlayoutUpdateable=true\n","userId":"20127","userName":"","uuid":"27ba3f04-1b5d-a086-508f-93bf2c6e6018"}
            at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:67)
            at com.liferay.portal.dao.orm.hibernate.SessionImpl.merge(SessionImpl.java:244)
            at com.liferay.portal.service.persistence.impl.LayoutPersistenceImpl.updateImpl(LayoutPersistenceImpl.java:16088)
            ... 74 more
    Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.liferay.portal.model.impl.LayoutImpl#21]
            at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:485)
            at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:255)
            at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)
            at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:867)
            at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:851)
            at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:855)
            at com.liferay.portal.dao.orm.hibernate.SessionImpl.merge(SessionImpl.java:241)
            ... 75 more
    

      Attachments

        Issue Links

          Activity

            People

            Assignee:
            joyce.wang Joyce Wang
            Reporter:
            joyce.wang Joyce Wang
            Participants of an Issue:
            Recent user:
            Jason Pince
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              15 weeks ago

                Packages

                Version Package
                7.3.1 CE GA2
                7.3.2 CE GA3
                7.3.10 DXP GA1
                Master