Issue
- We noticed that our site navigation menu is not editable anymore and it throws an error message and an exception in the logs when we open it:
<Menu> is temporarily unavailable.
java.lang.NullPointerException: null
at com.liferay.site.navigation.admin.web.internal.display.context.SiteNavigationAdminDisplayContext._getDefaultDDMTemplateKey(SiteNavigationAdminDisplayContext.java:483) ~[?:?]
at com.liferay.site.navigation.admin.web.internal.display.context.SiteNavigationAdminDisplayContext.lambda$_getDDMTemplatesJSONArray$10(SiteNavigationAdminDisplayContext.java:458) ~[?:?]
at com.liferay.portal.json.JSONObjectImpl.put(JSONObjectImpl.java:357) ~[portal-impl.jar:?]
at com.liferay.site.navigation.admin.web.internal.display.context.SiteNavigationAdminDisplayContext._getDDMTemplatesJSONArray(SiteNavigationAdminDisplayContext.java:453) ~[?:?]
at com.liferay.site.navigation.admin.web.internal.display.context.SiteNavigationAdminDisplayContext.getSiteNavigationContext(SiteNavigationAdminDisplayContext.java:269) ~[?:?]
at org.apache.jsp.edit_005fsite_005fnavigation_005fmenu_jsp._jspService(edit_005fsite_005fnavigation_005fmenu_jsp.java:251) ~[?:?]
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111) ~[jasper.jar:9.0.75]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[servlet-api.jar:4.0.FR]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411) ~[jasper.jar:9.0.75]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473) ~[jasper.jar:9.0.75]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377) ~[jasper.jar:9.0.75]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[servlet-api.jar:4.0.FR]
at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:328) ~[?:?]
at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:340) ~[?:?]
at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153) ~[?:?]
at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:63) ~[?:?]
at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120) ~[?:?]
at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48) ~[?:?]
at com.liferay.portlet.internal.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:291) ~[portal-impl.jar:?]
at com.liferay.portlet.internal.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:123) ~[portal-impl.jar:?]
Environment
- Liferay DXP 7.4
Resolution
- You can use the below script to check where the issue is:
import com.liferay.portal.kernel.template.TemplateHandler;
import com.liferay.portal.kernel.template.TemplateHandlerRegistryUtil;
import com.liferay.portal.kernel.util.PortalUtil;
import com.liferay.portal.kernel.theme.NavItem;
TemplateHandler templateHandler = TemplateHandlerRegistryUtil.getTemplateHandler(PortalUtil.getClassNameId(NavItem.class));
out.println("key='"+templateHandler.getDefaultTemplateKey()+"'");
- If the output is
key=''.
, then most probably the Navigation Menu DDM Template is set to an empty value - Go to System Settings > Navigation > Navigation Menu Template > DDM Template Key Default and reset the configuration to the default value (navbar-blank-ftl)
Subscriber Exclusive Content
A Liferay Enterprise Subscription provides access to over 1,500 articles that include best practices, troubleshooting, and other valuable solutions. Sign in for full access.
Sign In