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

NoSuchClassNameException when importing a web content template

    Description

    Steps to reproduce issue:

    1. Create a new site
    2. Navigate to Site Administration > Content > Web Content
    3. Open the kebab menu and select "Export / Import"
    4. Import the provided LAR

    Expected result: Import is successful, and templates are added
    Actual result: Import fails, and an exception is thrown:

    2018-08-03 20:50:26.879 WARN  [http-nio-8080-exec-7][PortalImpl:7848] Unable to impersonate 20139 because the string cannot be decrypted
    2018-08-03 20:50:30.926 ERROR [liferay/background_task-8][BackgroundTaskMessageListener:168] Unable to execute background task
    com.liferay.exportimport.kernel.lar.PortletDataException: Unable to get class name from id 30301
            at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:437)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:449)
            at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:435)
            at com.liferay.journal.internal.exportimport.data.handler.JournalPortletDataHandler.doImportData(JournalPortletDataHandler.java:367)
            at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:383)
            at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importPortletData(PortletImportControllerImpl.java:415)
            at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importPortletData(PortletImportControllerImpl.java:346)
            at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.doImportPortletInfo(PortletImportControllerImpl.java:1101)
            at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importFile(PortletImportControllerImpl.java:299)
            at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importPortletInfo(ExportImportLocalServiceImpl.java:462)
            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.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:158)
            at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
            at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
            at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:135)
            at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
            at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:135)
            at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:141)
            at com.sun.proxy.$Proxy125.importPortletInfo(Unknown Source)
            at com.liferay.exportimport.kernel.service.ExportImportLocalServiceUtil.importPortletInfo(ExportImportLocalServiceUtil.java:186)
            at com.liferay.exportimport.internal.background.task.PortletImportBackgroundTaskExecutor$PortletImportCallable.call(PortletImportBackgroundTaskExecutor.java:138)
            at com.liferay.exportimport.internal.background.task.PortletImportBackgroundTaskExecutor$PortletImportCallable.call(PortletImportBackgroundTaskExecutor.java:124)
            at com.liferay.portal.spring.transaction.TransactionInvokerImpl$CallableMethodInvocation.proceed(TransactionInvokerImpl.java:101)
            at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
            at com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:47)
            at com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28)
            at com.liferay.exportimport.internal.background.task.PortletImportBackgroundTaskExecutor.execute(PortletImportBackgroundTaskExecutor.java:88)
            at com.liferay.portal.background.task.internal.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:62)
            at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:43)
            at com.liferay.portal.background.task.internal.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:75)
            at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:127)
            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:756)
            at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:667)
            at java.lang.Thread.run(Thread.java:748)
    Caused by: java.lang.RuntimeException: Unable to get class name from id 30301
            at com.liferay.portal.util.PortalImpl.getClassName(PortalImpl.java:1588)
            at com.liferay.portal.kernel.util.PortalUtil.getClassName(PortalUtil.java:602)
            at com.liferay.dynamic.data.mapping.model.impl.DDMTemplateImpl.getResourceClassName(DDMTemplateImpl.java:75)
            at com.liferay.dynamic.data.mapping.web.internal.exportimport.data.handler.DDMTemplateStagedModelDataHandler.getResourceName(DDMTemplateStagedModelDataHandler.java:507)
            at com.liferay.dynamic.data.mapping.web.internal.exportimport.data.handler.DDMTemplateStagedModelDataHandler.doImportStagedModel(DDMTemplateStagedModelDataHandler.java:449)
            at com.liferay.dynamic.data.mapping.web.internal.exportimport.data.handler.DDMTemplateStagedModelDataHandler.doImportStagedModel(DDMTemplateStagedModelDataHandler.java:63)
            at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:396)
            ... 39 more
    Caused by: com.liferay.portal.kernel.exception.NoSuchClassNameException: No ClassName exists with the primary key 30301
            at com.liferay.portal.service.persistence.impl.ClassNamePersistenceImpl.findByPrimaryKey(ClassNamePersistenceImpl.java:609)
            at com.liferay.portal.service.persistence.impl.ClassNamePersistenceImpl.findByPrimaryKey(ClassNamePersistenceImpl.java:626)
            at com.liferay.portal.service.base.ClassNameLocalServiceBaseImpl.getClassName(ClassNameLocalServiceBaseImpl.java:221)
            at sun.reflect.GeneratedMethodAccessor689.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.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:158)
            at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
            at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
            at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:135)
            at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
            at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:135)
            at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:141)
            at com.sun.proxy.$Proxy48.getClassName(Unknown Source)
            at com.liferay.portal.kernel.service.ClassNameLocalServiceUtil.getClassName(ClassNameLocalServiceUtil.java:215)
            at com.liferay.portal.util.PortalImpl.getClassName(PortalImpl.java:1582)
            ... 45 more
    

    Reproduced on:
    Tomcat 9.0.6 + MySQL 5.7
    Portal Master GIT ID: c318f5676b6a255024b468c65cfc712da4fd3a23
    Portal 7.1.x GIT ID: efc01aa1c7a97d2ae59a1a302138e3cba48705d4
    Portal 7.1.x-private GIT ID: 1ac4d12bccc1bc337df7922a159167c3dfddac0e

      Attachments

        Activity

          People

          • Assignee:
            victor.ware Victor Ware
            Reporter:
            anthony.chu Anthony Chu
            Participants of an Issue:
            Recent user:
            Csaba Turcsan
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 10 weeks, 1 day ago

              Packages

              Version Package
              7.1.X
              Master