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

ORMException is thrown when republishing document entry

    Description

    Steps to reproduce:

    1. Add a new Site
    2. Add a new Page
    3. Enable local staging
    4. Add a new Document
    5. Add a new Web Content and insert a link to the previously uploaded Document
    6. Add a Web Content Display portlet to the page and select the previously created Web Content
    7. Add a Documents and Media portlet to a page
    8. Publish from Control Panel
      • Uncheck "Delete portlet data before importing."
      • Select "Choose Content"
        • Select Date Range: All
      • Hit Publish
    9. Assert document can be seen in the Web Content on Live.
    10. Move the Document to Trash on Live.
    11. Publish from Control Panel
      • Uncheck "Delete portlet data before importing."
      • Select "Choose Content"
        • Select Date Range: All (Refresh Counts)
        • Check "Documents and Media" (if unchecked)
      • Hit Publish
        Expected Result: Publication is successful and Document is restored from Trash so it can be seen in the WCD again.

    Actual Result:
    Publication is failed due to ORMException.

    2019-09-29 02:50:01.881 ERROR [liferay/background_task-3][BackgroundTaskMessageListener:172] Unable to execute background task
    com.liferay.exportimport.kernel.lar.PortletDataException: com.liferay.portal.kernel.dao.orm.ORMException: {"assetDisplayPageEntryId":"38154","classNameId":"20008","classPK":"38148","companyId":"20096","createDate":1569724389813,"groupId":"38044","layoutPageTemplateEntryId":"0","modifiedDate":1569725401866,"mvccVersion":"0","plid":"0","type":1,"userId":"20125","userName":"Test Test","uuid":"af1f5622-a7d6-5c2b-4007-4f5668815c64"} is stale in comparison to {"assetDisplayPageEntryId":"38154","classNameId":"20008","classPK":"38148","companyId":"20096","createDate":1569724389813,"groupId":"38044","layoutPageTemplateEntryId":"0","modifiedDate":1569724462793,"mvccVersion":"1","plid":"0","type":1,"userId":"20125","userName":"Test Test","uuid":"af1f5622-a7d6-5c2b-4007-4f5668815c64"}
            at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:433)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:453)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:439)
            at com.liferay.document.library.internal.exportimport.data.handler.FileEntryStagedModelDataHandler._importAssetDisplayPage(FileEntryStagedModelDataHandler.java:994)
            at com.liferay.document.library.internal.exportimport.data.handler.FileEntryStagedModelDataHandler.doImportStagedModel(FileEntryStagedModelDataHandler.java:671)
            at com.liferay.document.library.internal.exportimport.data.handler.FileEntryStagedModelDataHandler.doImportStagedModel(FileEntryStagedModelDataHandler.java:111)
            at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:392)
            at com.liferay.document.library.internal.exportimport.data.handler.FileEntryStagedModelDataHandler.importStagedModel(FileEntryStagedModelDataHandler.java:196)
            at com.liferay.document.library.internal.exportimport.data.handler.FileEntryStagedModelDataHandler.importStagedModel(FileEntryStagedModelDataHandler.java:111)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:453)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:439)
            at com.liferay.document.library.web.internal.lar.DLAdminPortletDataHandler.doImportData(DLAdminPortletDataHandler.java:279)
            at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:385)
            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:323)
            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:453)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:439)
            at com.liferay.exportimport.internal.controller.LayoutImportController.doImportFile(LayoutImportController.java:563)
            at com.liferay.exportimport.internal.controller.LayoutImportController.importFile(LayoutImportController.java:216)
            at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importLayouts(ExportImportLocalServiceImpl.java:211)
            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.$Proxy150.importLayouts(Unknown Source)
            at com.liferay.exportimport.kernel.service.ExportImportLocalServiceUtil.importLayouts(ExportImportLocalServiceUtil.java:124)
            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.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.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: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:131)
            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:752)
            at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:664)
            at java.lang.Thread.run(Thread.java:745)
    Caused by: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: {"assetDisplayPageEntryId":"38154","classNameId":"20008","classPK":"38148","companyId":"20096","createDate":1569724389813,"groupId":"38044","layoutPageTemplateEntryId":"0","modifiedDate":1569725401866,"mvccVersion":"0","plid":"0","type":1,"userId":"20125","userName":"Test Test","uuid":"af1f5622-a7d6-5c2b-4007-4f5668815c64"} is stale in comparison to {"assetDisplayPageEntryId":"38154","classNameId":"20008","classPK":"38148","companyId":"20096","createDate":1569724389813,"groupId":"38044","layoutPageTemplateEntryId":"0","modifiedDate":1569724462793,"mvccVersion":"1","plid":"0","type":1,"userId":"20125","userName":"Test Test","uuid":"af1f5622-a7d6-5c2b-4007-4f5668815c64"}
            at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:446)
            at com.liferay.asset.display.page.service.persistence.impl.AssetDisplayPageEntryPersistenceImpl.updateImpl(AssetDisplayPageEntryPersistenceImpl.java:3232)
            at com.liferay.asset.display.page.service.persistence.impl.AssetDisplayPageEntryPersistenceImpl.updateImpl(AssetDisplayPageEntryPersistenceImpl.java:75)
            at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.update(BasePersistenceImpl.java:544)
            at com.liferay.asset.display.page.service.base.AssetDisplayPageEntryLocalServiceBaseImpl.updateAssetDisplayPageEntry(AssetDisplayPageEntryLocalServiceBaseImpl.java:517)
            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.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.$Proxy632.updateAssetDisplayPageEntry(Unknown Source)
            at com.liferay.asset.display.page.internal.exportimport.staged.model.repository.AssetDisplayPageStagedModelRepository.updateStagedModel(AssetDisplayPageStagedModelRepository.java:151)
            at com.liferay.asset.display.page.internal.exportimport.staged.model.repository.AssetDisplayPageStagedModelRepository.updateStagedModel(AssetDisplayPageStagedModelRepository.java:36)
            at com.liferay.asset.display.page.internal.exportimport.data.handler.AssetDisplayPageStagedModelDataHandler.doImportStagedModel(AssetDisplayPageStagedModelDataHandler.java:144)
            at com.liferay.asset.display.page.internal.exportimport.data.handler.AssetDisplayPageStagedModelDataHandler.doImportStagedModel(AssetDisplayPageStagedModelDataHandler.java:38)
            at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:392)
            ... 49 more
    Caused by: com.liferay.portal.kernel.dao.orm.ORMException: {"assetDisplayPageEntryId":"38154","classNameId":"20008","classPK":"38148","companyId":"20096","createDate":1569724389813,"groupId":"38044","layoutPageTemplateEntryId":"0","modifiedDate":1569725401866,"mvccVersion":"0","plid":"0","type":1,"userId":"20125","userName":"Test Test","uuid":"af1f5622-a7d6-5c2b-4007-4f5668815c64"} is stale in comparison to {"assetDisplayPageEntryId":"38154","classNameId":"20008","classPK":"38148","companyId":"20096","createDate":1569724389813,"groupId":"38044","layoutPageTemplateEntryId":"0","modifiedDate":1569724462793,"mvccVersion":"1","plid":"0","type":1,"userId":"20125","userName":"Test Test","uuid":"af1f5622-a7d6-5c2b-4007-4f5668815c64"}
            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.asset.display.page.service.persistence.impl.AssetDisplayPageEntryPersistenceImpl.updateImpl(AssetDisplayPageEntryPersistenceImpl.java:3227)
            ... 68 more
    Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.liferay.asset.display.page.model.impl.AssetDisplayPageEntryImpl#38154]
            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)
            ... 69 more
    

      Attachments

        Issue Links

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 weeks, 2 days ago

                Packages

                Version Package
                7.2.10 DXP FP2
                7.2.10.1 DXP SP1
                7.2.X
                7.2.1 CE GA2
                Master