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

When exporting to staging local, the following exception is thrown: "NoSuchArticleException: No JournalArticle exists with the key"

    Details

    • Branch Version/s:
      6.2.x
    • Backported to Branch:
      Committed
    • Story Points:
      9
    • Fix Priority:
      3

      Description

      When exporting to staging local, the following exception is thrown for every webcontent object that is published

      11:08:44,501 DEBUG [liferay/background_task-1][BaseStagedModelDataHandler:286] com.liferay.portlet.journal.NoSuchArticleException: No JournalArticle exists with the key {resourcePrimKey=374734}
      com.liferay.portlet.journal.NoSuchArticleException: No JournalArticle exists with the key {resourcePrimKey=374734}
      	at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getLatestArticle(JournalArticleLocalServiceImpl.java:2786)
      	at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getLatestArticle(JournalArticleLocalServiceImpl.java:2736)
      	at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getLatestArticle(JournalArticleLocalServiceImpl.java:2714)
      	at sun.reflect.GeneratedMethodAccessor387.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	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.$Proxy220.getLatestArticle(Unknown Source)
      	at com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil.getLatestArticle(JournalArticleLocalServiceUtil.java:1789)
      	at com.liferay.portlet.journal.trash.JournalArticleTrashHandler.isInTrash(JournalArticleTrashHandler.java:176)
      	at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.validateExport(BaseStagedModelDataHandler.java:272)
      	at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:53)
      	at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.exportStagedModel(StagedModelDataHandlerUtil.java:173)
      

      The problem is produced at "trashHandler.isInTrash" invocation, at BaseStagedModelDataHandler class

      				classPK = (Long)stagedModel.getPrimaryKeyObj();
      
      				if (trashHandler.isInTrash(classPK)) {
      					PortletDataException pde = new PortletDataException(
      						PortletDataException.STATUS_IN_TRASH);
      
      					pde.setStagedModel(stagedModel);
      
      					throw pde;
      				}
      

      Root cause of this problem is:

      1. JournalArticleTrashHandler.isInTrash(long classPK) expects "resourcePrimKey" as input
      2. At BaseStagedModelDataHandler the getPrimaryKeyObj is used for JournalArticle ('id_' instead 'resourceprimkey') so no JournalArticle is obtained from database

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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

                  Subcomponents