Legacy Knowledge Base
Published Sep. 10, 2025

The Theme is Broken With NPE thrown in the Log

Written By

Laura Li

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • The theme is broken when accessing non-existent pages. NPE is also thrown in the log.
  • Reproduction Steps:

    Access non-existent pages
    http://localhost:8080/web/guest/p/
    Or create a commerce site named "xyz" and access non-existent pages
    http://localhost:8080/group/xyz/p/

    Result:The theme is broken with some JS errors. NPE is thrown in the log.
    2023-02-28 02:19:46.382 ERROR [http-nio-8080-exec-6][IncludeTag:128] Current URL /group/xyz/p/ujoint123 generates exception: null
    java.lang.NullPointerException
    	at com.liferay.portal.util.PortalImpl._getAlternateURLs(PortalImpl.java:8293)
    	at com.liferay.portal.util.PortalImpl.getAlternateURLs(PortalImpl.java:1228)
    	at com.liferay.portal.kernel.util.PortalUtil.getAlternateURLs(PortalUtil.java:376)
    	at org.apache.jsp.html.common.themes.top_005fhead_jsp._jspService(top_005fhead_jsp.java:1237)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:779)
    	at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
    	at com.liferay.portal.servlet.DirectRequestDispatcherFactoryImpl$IndirectRequestDispatcher.include(DirectRequestDispatcherFactoryImpl.java:190)
    	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:79)
    	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
    	at com.liferay.taglib.util.IncludeTag.includePage(IncludeTag.java:407)
    	at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:383)
    	at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:217)
    	at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:88)
    	at freemarker.ext.jsp.TagTransformModel$TagWriter.endEvaluation(TagTransformModel.java:402)
    	at freemarker.ext.jsp.TagTransformModel$TagWriter.afterBody(TagTransformModel.java:390)
    	at freemarker.core.Environment.visitAndTransform(Environment.java:497)
    	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:103)
    	at freemarker.core.Environment.visit(Environment.java:331)
    	at freemarker.core.Environment.visit(Environment.java:337)
    

 

Environment

  • Liferay DXP 7.3

 

Resolution

  • The fix LPS-177132 can resolve the issue. Please request a hotfix to include this fix or install 7.3 Update 69.

 

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base