"Portlet must not be null" error during upgrade

Issue

  • You might encounter an issue where you face an error during upgrade such as follows:
    2023-03-29 08:09:14.891 ERROR [Framework Event Dispatcher: Equinox Container: 6a56b6f1-2524-4207-a9fb-dfe9b3dab41e][Framework:56] FrameworkEvent ERROR
    java.lang.IllegalArgumentException: Portlet must not be null
      at com.liferay.portal.security.permission.ResourceActionsImpl.populatePortletResource(ResourceActionsImpl.java:494) ~[portal-impl.jar:?]
      at com.liferay.object.internal.security.permission.resource.util.ObjectDefinitionResourcePermissionUtil.populateResourceActions(ObjectDefinitionResourcePermissionUtil.java:76) ~[?:?]
        at com.liferay.object.internal.deployer.ObjectDefinitionDeployerImpl.deploy(ObjectDefinitionDeployerImpl.java:186) ~[?:?]
      at com.liferay.object.service.impl.ObjectDefinitionLocalServiceImpl._addingObjectDefinitionDeployer(ObjectDefinitionLocalServiceImpl.java:808) ~[?:?]
      at com.liferay.object.service.impl.ObjectDefinitionLocalServiceImpl.setAopProxy(ObjectDefinitionLocalServiceImpl.java:594) ~[?:?]
      at com.liferay.portal.aop.internal.AopServiceRegistrar._getService(AopServiceRegistrar.java:146) ~[?:?]
      at com.liferay.portal.aop.internal.AopServiceRegistrar.register(AopServiceRegistrar.java:80) ~[?:?]
      at com.liferay.portal.aop.internal.AopServiceResolver.addAopServiceRegistrar(AopServiceResolver.java:38) ~[?:?]
      at com.liferay.portal.aop.internal.AopServiceManager$AopServiceServiceTrackerCustomizer.addingService(AopServiceManager.java:124) ~[?:?]
      at com.liferay.portal.aop.internal.AopServiceManager$AopServiceServiceTrackerCustomizer.addingService(AopServiceManager.java:96) ~[?:?]
      at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943) ~[org.eclipse.osgi.jar:?]
    ...

Environment

  • Liferay DXP 7.4+

Resolution

  • This is a known issue, that will be solved in LPS-169398.
    • The object definition is missing after the upgrade because it wasn't indexed to the Search Engine during the upgrade process.
    • Executing a reindex will fix the issue.
  • As a workaround, If that doesn't fix your issue, you can also check your objectdefinition table and delete the problematic Object Definition using the following script to get rid of the entry:
    import com.liferay.object.service.ObjectDefinitionServiceUtil;
    ObjectDefinitionServiceUtil.deleteObjectDefinition(objectDefinitionId);

 

¿Fue útil este artículo?
Usuarios a los que les pareció útil: 1 de 2