Details
-
Task
-
Status: Closed
-
Minor
-
Resolution: Completed
-
None
-
None
Description
ObjectEntriesPanelApp can sometimes throw a NPE.
1.) Type: git ls-files **PanelApp.java
Notice that all implemenetations have
{{ @Override @Override @Reference( target = "(javax.portlet.name=" + SiteAdminPortletKeys.SITE_ADMIN + ")", unbind = "-" ) public void setPortlet(Portlet portlet) { super.setPortlet(portlet); }}}
2.) See PanelAppRegistry.java
{{ Portlet portlet = _portletLocalService.getPortletById( Portlet portlet = _portletLocalService.getPortletById( panelApp.getPortletId());}}
{{ if (portlet != null) { portlet.setControlPanelEntryCategory(panelCategoryKey);}}
{{ panelApp.setPortlet(portlet); }}}
To ensure that the portlet is never NULL, register ObjectEntriesPanelApp AFTER ObjectEntriesPortlet is registered.
3.) See exception log:
Caused by: java.lang.NullPointerException
{{ at com.liferay.application.list.BasePanelApp.getGroup(BasePanelApp.java:205) ~[bundleFile:?]}}
{{ at com.liferay.application.list.BasePanelApp.getPortletURL(BasePanelApp.java:118) ~[bundleFile:?]}}
{{ at com.liferay.object.web.internal.object.entries.application.list.ObjectEntriesPanelApp.getPortletURL(ObjectEntriesPanelApp.java:62) ~[?:?]}}
{{ at com.liferay.depot.web.internal.application.list.DepotPanelAppController$PanelAppWrapper.getPortletURL(DepotPanelAppController.java:209) ~[?:?]}}
{{ at com.liferay.product.navigation.applications.menu.web.internal.portlet.action.ApplicationsMenuPanelAppsMVCResourceCommand._getPanelAppJSONObject(ApplicationsMenuPanelAppsMVCResourceCommand.java:175) ~[bundleFile:?]}}
{{ at com.liferay.product.navigation.applications.menu.web.internal.portlet.action.ApplicationsMenuPanelAppsMVCResourceCommand._getPanelAppsJSONArray(ApplicationsMenuPanelAppsMVCResourceCommand.java:192) ~[bundleFile:?]}}
{{ at com.liferay.product.navigation.applications.menu.web.internal.portlet.action.ApplicationsMenuPanelAppsMVCResourceCommand._getChildPanelCategoriesJSONArray(ApplicationsMenuPanelAppsMVCResourceCommand.java:124) ~[bundleFile:?]}}
{{ at com.liferay.product.navigation.applications.menu.web.internal.portlet.action.ApplicationsMenuPanelAppsMVCResourceCommand._getPanelCategoriesJSONArray(ApplicationsMenuPanelAppsMVCResourceCommand.java:213) ~[bundleFile:?]}}
{{ at com.liferay.product.navigation.applications.menu.web.internal.portlet.action.ApplicationsMenuPanelAppsMVCResourceCommand._getApplicationsMenuContextJSONObject(ApplicationsMenuPanelAppsMVCResourceCommand.java:99) ~[bundleFile:?]}}
{{ at com.liferay.product.navigation.applications.menu.web.internal.portlet.action.ApplicationsMenuPanelAppsMVCResourceCommand.doServeResource(ApplicationsMenuPanelAppsMVCResourceCommand.java:84) ~[bundleFile:?]}}
{{ at com.liferay.portal.kernel.portlet.bridges.mvc.BaseMVCResourceCommand.serveResource(BaseMVCResourceCommand.java:41) ~[portal-kernel.jar:?]}}
{{ ... 157 more}}