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

Export Documents and Media Portlet with Global Categories fails with ClassCastException

    Details

      Description

      steps to reproduce
      1) create a Global category
      2) create a document NOT in Global, but in the site scope
      3) associate the global category with the document
      4) export Documents and Media

      expected: document and media portlet exports successfully
      actual: export fails with ClassCastException

      17:36:48,349 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:133] Unable to execute background task
      com.liferay.portal.kernel.exception.SystemException: java.lang.ClassCastException: com.liferay.portlet.documentlibrary.model.impl.DLFileEntryImpl cannot be cast to com.liferay.portal.kernel.repository.model.FileEntry
              at com.liferay.portal.service.impl.LayoutLocalServiceImpl.exportPortletInfoAsFile(LayoutLocalServiceImpl.java:1008)
              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:183)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice.invoke(LayoutLocalServiceStagingAdvice.java:141)
              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:51)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
              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.$Proxy35.exportPortletInfoAsFile(Unknown Source)
              at com.liferay.portal.service.LayoutLocalServiceUtil.exportPortletInfoAsFile(LayoutLocalServiceUtil.java:788)
              at com.liferay.portal.lar.backgroundtask.PortletExportBackgroundTaskExecutor.execute(PortletExportBackgroundTaskExecutor.java:63)
              at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:56)
              at com.liferay.portal.backgroundtask.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:108)
              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:744)
      Caused by: java.lang.ClassCastException: com.liferay.portlet.documentlibrary.model.impl.DLFileEntryImpl cannot be cast to com.liferay.portal.kernel.repository.model.FileEntry
              at com.liferay.portlet.documentlibrary.lar.FileEntryStagedModelDataHandler.getDisplayName(FileEntryStagedModelDataHandler.java:1)
              at com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil.getDisplayName(StagedModelDataHandlerUtil.java:185)
              at com.liferay.portal.lar.PortletDataContextImpl.doAddReferenceElement(PortletDataContextImpl.java:2378)
              at com.liferay.portal.lar.PortletDataContextImpl.addReferenceElement(PortletDataContextImpl.java:651)
              at com.liferay.portal.lar.PortletDataContextImpl.addReferenceElement(PortletDataContextImpl.java:601)
              at com.liferay.portal.lar.PortletExporter.exportAssetCategories(PortletExporter.java:573)
              at com.liferay.portal.lar.PortletExporter.exportAssetCategories(PortletExporter.java:502)
              at com.liferay.portal.lar.PortletExporter.doExportPortletInfoAsFile(PortletExporter.java:460)
              at com.liferay.portal.lar.PortletExporter.exportPortletInfoAsFile(PortletExporter.java:301)
              at com.liferay.portal.service.impl.LayoutLocalServiceImpl.exportPortletInfoAsFile(LayoutLocalServiceImpl.java:998)
              ... 42 more

      6.2.x issue only because it is caused by LPS-60419

        Attachments

        1. fix.png
          fix.png
          31 kB
        2. fix-62.png
          fix-62.png
          48 kB
        3. reproduce.png
          reproduce.png
          47 kB

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 39 weeks, 2 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 Beta 5