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

ResourceImporter throws PrincipalException while importing files to Global scope if expando fields are present

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: No Longer Reproducible
    • Affects Version/s: 6.2.3 CE GA4
    • Fix Version/s: None
    • Labels:
      None
    • Story Points:
      1.5

      Description

      Description

      I use Resource Importer to create initial portal configuration and to update global resources when new files are added. Everything works fine, RI imports and updates everything each time it is deployed to Liferay instance until I add any expando field to Documents and Media Document. After that, Resources Importer fails each time the plugin is deployed (adding Guest READ and UPDATE permissions do not solve the problem).

      Steps to reproduce

      1. Create random plugin with resources importer enabled (for Global scope) that includes at least one file under /src/main/resources/resources-importer/document_library/documents (my test plugin is attached to this task)
      2. Build and deploy
      3. Resources from documents folder should be imported to Globally-scoped Documents Library
      4. Deploy war once again
      5. Existing files should will be updated (version number is increased)
      6. Create random expando field for Documents and Media Document
      7. Deploy war once again

      Expected result

      Files in Global scope should be updated once again.

      Actual result

      Plugin is deployed but Resources Importer fails with the following exception:

      13:10:44,361 ERROR [liferay/hot_deploy-1][SerialDestination:68] Unable to process message {destinationName=liferay/hot_deploy, response=null, responseDestinationName=null, responseId=null, payload=null, values={groupId=0, command=deploy, companyId=0, servletContextName=resource-importer-expando-tester-1.0}}
      com.liferay.portal.kernel.messaging.MessageListenerException: java.lang.RuntimeException: com.liferay.portal.security.auth.PrincipalException: PermissionChecker not initialized
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
      	at com.liferay.portal.kernel.messaging.SerialDestination$1.run(SerialDestination.java:65)
      	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:745)
      Caused by: java.lang.RuntimeException: com.liferay.portal.security.auth.PrincipalException: PermissionChecker not initialized
      	at com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl.getAttribute(ExpandoBridgeImpl.java:219)
      	at com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl.getAttributes(ExpandoBridgeImpl.java:283)
      	at com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl.getAttributes(ExpandoBridgeImpl.java:273)
      	at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.checkOutFileEntry(DLFileEntryLocalServiceImpl.java:530)
      	at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.checkOutFileEntry(DLFileEntryLocalServiceImpl.java:470)
      	at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.updateFileEntry(DLFileEntryLocalServiceImpl.java:2272)
      	at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.updateFileEntry(DLFileEntryLocalServiceImpl.java:1579)
      	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: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.$Proxy211.updateFileEntry(Unknown Source)
      	at com.liferay.portal.repository.liferayrepository.LiferayLocalRepository.updateFileEntry(LiferayLocalRepository.java:343)
      	at com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl.updateFileEntry(DLAppLocalServiceImpl.java:1175)
      	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: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.$Proxy207.updateFileEntry(Unknown Source)
      	at com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil.updateFileEntry(DLAppLocalServiceUtil.java:832)
      	at com.liferay.resourcesimporter.util.FileSystemImporter.addDLFileEntry(FileSystemImporter.java:709)
      	at com.liferay.resourcesimporter.util.ResourceImporter.addDLFileEntry(ResourceImporter.java:276)
      	at com.liferay.resourcesimporter.util.ResourceImporter.addDLFileEntries(ResourceImporter.java:259)
      	at com.liferay.resourcesimporter.util.FileSystemImporter.setUpAssets(FileSystemImporter.java:1659)
      	at com.liferay.resourcesimporter.util.FileSystemImporter.doImportResources(FileSystemImporter.java:1264)
      	at com.liferay.resourcesimporter.util.ResourceImporter.importResources(ResourceImporter.java:47)
      	at com.liferay.resourcesimporter.messaging.ResourcesImporterHotDeployMessageListener.importResources(ResourcesImporterHotDeployMessageListener.java:124)
      	at com.liferay.resourcesimporter.messaging.ResourcesImporterHotDeployMessageListener.initialize(ResourcesImporterHotDeployMessageListener.java:73)
      	at com.liferay.resourcesimporter.messaging.ResourcesImporterHotDeployMessageListener.onDeploy(ResourcesImporterHotDeployMessageListener.java:86)
      	at com.liferay.portal.kernel.messaging.HotDeployMessageListener.doReceive(HotDeployMessageListener.java:55)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      	... 5 more
      Caused by: com.liferay.portal.security.auth.PrincipalException: PermissionChecker not initialized
      	at com.liferay.portal.service.BaseServiceImpl.getPermissionChecker(BaseServiceImpl.java:82)
      	at com.liferay.portlet.expando.service.impl.ExpandoValueServiceImpl.getData(ExpandoValueServiceImpl.java:123)
      	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: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.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
      	at com.sun.proxy.$Proxy140.getData(Unknown Source)
      	at com.liferay.portlet.expando.service.ExpandoValueServiceUtil.getData(ExpandoValueServiceUtil.java:107)
      	at com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl.getAttribute(ExpandoBridgeImpl.java:208)
      	... 45 more
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 5 weeks, 1 day ago

                Packages

                Version Package