Legacy Knowledge Base
Published Sep. 10, 2025

JSPs stop working if their osgi module is restarted and direct.servlet.context.reload property is configured to false

Written By

Jorge Diaz

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

  • JSPs stop working if their osgi module is restarted and the direct servlet context reload functionality is disabled with the direct.servlet.context.reload=false setting.
  • The issue is also reproduced in case:
    • You deploy a new osgi fragment module that overrides an existing JSP module (see JSP Overrides Using-OSGi Fragments) in a running Liferay environment.
    • You deploy a new version of an existing module that contains JSPs in a running Liferay environment.
  • The following exception can be also thrown due to this issue:
    2018-01-29 05:30:59.053 ERROR [http-nio-8080-exec-7][IncludeTag:128] Current URL /group/control_panel/manage?p_p_id=com_liferay_server_admin_web_portlet_ServerAdminPortlet&p_p_lifecycle=0&p_p_state=maximized generates exception: null
    java.lang.NullPointerException
    	at com.liferay.taglib.servlet.PageContextWrapper.handlePageException(PageContextWrapper.java:173)
    	at org.apache.jsp.server_jsp._jspService(server_jsp:653)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    	at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:64)
    	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
    	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
    	at com.liferay.taglib.util.IncludeTag.includePage(IncludeTag.java:372)
    	at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:349)
    	at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:202)
    	at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:86)
    	at org.apache.jsp.view_jsp._jspService(view_jsp:432)

Environment

  • DXP 7.0
  • DXP 7.1
  • DXP 7.2
  • DXP 7.3

Resolution

  • Disabling the direct servlet context reload functionality with direct.servlet.context.reload=false is not compatible with any functionality that relies on the JSP dynamic reloading ability at runtime.
  • If you have disabled it, any administrative operation that causes a JSP dynamic reloading at runtime will cause that JSP to stop working.
  • Some of these operations are:
    • Manual stop / start of a module that contains a JSP file.
    • Deploying a new osgi module version of an existing module.
    • Deploying a new osgi fragment to override an existing JSP file of other module.
  • To avoid this issue you have two options:
    • Always restart the application server after these operations in order to force a reload of the JSP file.
    • Remove the direct.servlet.context.reload=false property and enable the direct servlet context reload functionality.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base