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
    • Similar Issues:
      Show 5 results 

      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

        Activity

        Hide
        Eudaldo Alonso added a comment -

        Just started reviewing :)

        Sent from GH.

        Show
        Eudaldo Alonso added a comment - Just started reviewing :) Sent from GH .
        Hide
        Linda Sui added a comment - - edited

        PASSED Manual Testing using the steps on Lyon's comment.

        Reproduced on:
        Tomcat 7.0.42 + MySQL 5.5.21. Portal master GIT ID: 88b008b37c129692e8c85993bfaa09ccb2e8336b.

        When I publish staging to live the NoSuchArticleException is thrown

        06:23:09,451 DEBUG [liferay/background_task-1][BaseStagedModelDataHandler:544] com.liferay.portlet.journal.NoSuchArticleException: No JournalArticle exists with the key {resourcePrimKey=10526}
        com.liferay.portlet.journal.NoSuchArticleException: No JournalArticle exists with the key {resourcePrimKey=10526}
        	at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getLatestArticle(JournalArticleLocalServiceImpl.java:2524)
        	at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getLatestArticle(JournalArticleLocalServiceImpl.java:2474)
        	at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getLatestArticle(JournalArticleLocalServiceImpl.java:2453)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        	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:55)
        	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
        	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
        	at com.sun.proxy.$Proxy121.getLatestArticle(Unknown Source)
        	at com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil.getLatestArticle(JournalArticleLocalServiceUtil.java:1708)
        	at com.liferay.portlet.journal.trash.JournalArticleTrashHandler.isInTrash(JournalArticleTrashHandler.java:173)
        	at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.validateExport(BaseStagedModelDataHandler.java:530)
        	at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:66)
        	at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.exportStagedModel(StagedModelDataHandlerUtil.java:151)
        	at com.liferay.portlet.journal.lar.JournalPortletDataHandler$1.performAction(JournalPortletDataHandler.java:354)
        	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performAction(BaseActionableDynamicQuery.java:367)
        	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery$1.call(BaseActionableDynamicQuery.java:267)
        	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery$1.call(BaseActionableDynamicQuery.java:1)
        	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.doPerformActions(BaseActionableDynamicQuery.java:286)
        	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performActions(BaseActionableDynamicQuery.java:91)
        	at com.liferay.portlet.journal.lar.JournalPortletDataHandler.doExportData(JournalPortletDataHandler.java:199)
        	at com.liferay.portal.kernel.lar.BasePortletDataHandler.exportData(BasePortletDataHandler.java:143)
        	at com.liferay.portal.lar.PortletExporter.exportPortletData(PortletExporter.java:196)
        	at com.liferay.portal.lar.PortletExporter.exportPortlet(PortletExporter.java:749)
        	at com.liferay.portal.lar.LayoutExporter.doExportLayoutsAsFile(LayoutExporter.java:523)
        	at com.liferay.portal.lar.LayoutExporter.exportLayoutsAsFile(LayoutExporter.java:184)
        	at com.liferay.portal.service.impl.LayoutLocalServiceImpl.exportLayoutsAsFile(LayoutLocalServiceImpl.java:883)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        	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.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:139)
        	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:55)
        	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
        	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
        	at com.sun.proxy.$Proxy118.exportLayoutsAsFile(Unknown Source)
        	at com.liferay.portal.service.LayoutLocalServiceUtil.exportLayoutsAsFile(LayoutLocalServiceUtil.java:528)
        	at com.liferay.portal.lar.backgroundtask.LayoutStagingBackgroundTaskExecutor$LayoutStagingCallable.call(LayoutStagingBackgroundTaskExecutor.java:189)
        	at com.liferay.portal.lar.backgroundtask.LayoutStagingBackgroundTaskExecutor$LayoutStagingCallable.call(LayoutStagingBackgroundTaskExecutor.java:1)
        	at com.liferay.portal.spring.transaction.TransactionalCallableUtil$CallableMethodInvocation.proceed(TransactionalCallableUtil.java:84)
        	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
        	at com.liferay.portal.spring.transaction.TransactionalCallableUtil.call(TransactionalCallableUtil.java:36)
        	at com.liferay.portal.lar.backgroundtask.LayoutStagingBackgroundTaskExecutor.execute(LayoutStagingBackgroundTaskExecutor.java:96)
        	at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:56)
        	at com.liferay.portal.backgroundtask.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:111)
        	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:724)
        

        Fixed on:
        Tomcat 7.0.42 + MySQL 5.5.21. Portal ee-6.2.x EE GIT ID: 74063c13dbdfaae714ea4faa627702b94eb38e84.
        Tomcat 7.0.42 + MySQL 5.5.21. Portal master GIT ID: f7142cca043cd4833665c2b4445ed1601beee62a.

        Publish staging to live successfully and no error throws.

        Show
        Linda Sui added a comment - - edited PASSED Manual Testing using the steps on Lyon's comment. Reproduced on: Tomcat 7.0.42 + MySQL 5.5.21. Portal master GIT ID: 88b008b37c129692e8c85993bfaa09ccb2e8336b. When I publish staging to live the NoSuchArticleException is thrown 06:23:09,451 DEBUG [liferay/background_task-1][BaseStagedModelDataHandler:544] com.liferay.portlet.journal.NoSuchArticleException: No JournalArticle exists with the key {resourcePrimKey=10526} com.liferay.portlet.journal.NoSuchArticleException: No JournalArticle exists with the key {resourcePrimKey=10526} at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getLatestArticle(JournalArticleLocalServiceImpl.java:2524) at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getLatestArticle(JournalArticleLocalServiceImpl.java:2474) at com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl.getLatestArticle(JournalArticleLocalServiceImpl.java:2453) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 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:55) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169) at com.sun.proxy.$Proxy121.getLatestArticle(Unknown Source) at com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil.getLatestArticle(JournalArticleLocalServiceUtil.java:1708) at com.liferay.portlet.journal.trash.JournalArticleTrashHandler.isInTrash(JournalArticleTrashHandler.java:173) at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.validateExport(BaseStagedModelDataHandler.java:530) at com.liferay.portal.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:66) at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.exportStagedModel(StagedModelDataHandlerUtil.java:151) at com.liferay.portlet.journal.lar.JournalPortletDataHandler$1.performAction(JournalPortletDataHandler.java:354) at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performAction(BaseActionableDynamicQuery.java:367) at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery$1.call(BaseActionableDynamicQuery.java:267) at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery$1.call(BaseActionableDynamicQuery.java:1) at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.doPerformActions(BaseActionableDynamicQuery.java:286) at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performActions(BaseActionableDynamicQuery.java:91) at com.liferay.portlet.journal.lar.JournalPortletDataHandler.doExportData(JournalPortletDataHandler.java:199) at com.liferay.portal.kernel.lar.BasePortletDataHandler.exportData(BasePortletDataHandler.java:143) at com.liferay.portal.lar.PortletExporter.exportPortletData(PortletExporter.java:196) at com.liferay.portal.lar.PortletExporter.exportPortlet(PortletExporter.java:749) at com.liferay.portal.lar.LayoutExporter.doExportLayoutsAsFile(LayoutExporter.java:523) at com.liferay.portal.lar.LayoutExporter.exportLayoutsAsFile(LayoutExporter.java:184) at com.liferay.portal.service.impl.LayoutLocalServiceImpl.exportLayoutsAsFile(LayoutLocalServiceImpl.java:883) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 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.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:139) 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:55) at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169) at com.sun.proxy.$Proxy118.exportLayoutsAsFile(Unknown Source) at com.liferay.portal.service.LayoutLocalServiceUtil.exportLayoutsAsFile(LayoutLocalServiceUtil.java:528) at com.liferay.portal.lar.backgroundtask.LayoutStagingBackgroundTaskExecutor$LayoutStagingCallable.call(LayoutStagingBackgroundTaskExecutor.java:189) at com.liferay.portal.lar.backgroundtask.LayoutStagingBackgroundTaskExecutor$LayoutStagingCallable.call(LayoutStagingBackgroundTaskExecutor.java:1) at com.liferay.portal.spring.transaction.TransactionalCallableUtil$CallableMethodInvocation.proceed(TransactionalCallableUtil.java:84) at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62) at com.liferay.portal.spring.transaction.TransactionalCallableUtil.call(TransactionalCallableUtil.java:36) at com.liferay.portal.lar.backgroundtask.LayoutStagingBackgroundTaskExecutor.execute(LayoutStagingBackgroundTaskExecutor.java:96) at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:56) at com.liferay.portal.backgroundtask.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:111) 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:724) Fixed on: Tomcat 7.0.42 + MySQL 5.5.21. Portal ee-6.2.x EE GIT ID: 74063c13dbdfaae714ea4faa627702b94eb38e84. Tomcat 7.0.42 + MySQL 5.5.21. Portal master GIT ID: f7142cca043cd4833665c2b4445ed1601beee62a. Publish staging to live successfully and no error throws.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              17 weeks, 5 days ago

              Development

                Structure Helper Panel