Issue
-
We start with a state where we have a jsp fragment deployed and is working fine.
We then make a change to that module and do a hot deployment.
After that, the page on which the fragment is being used shows only the portlet title and no portlet body. The logs show NullPointerException exception. That goes away when the server is restarted.
-
Stack trace could look something like this:
[15.05.2019 10:05:54,772 +0300] ERROR [http-nio-443-exec-10][IncludeTag:128] Current URL ... generates exception: null
java.lang.NullPointerException
at com.liferay.taglib.servlet.PageContextWrapper.handlePageException(PageContextWrapper.java:173)
at org.apache.jsp.journal_005fresources_jsp._jspService(journal_005fresources_jsp:478)
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.configuration_jsp._jspService(configuration_jsp:471)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at com.liferay.portal.osgi.web.servlet.jsp.compiler.JspServlet.service(JspServlet.java:417)
at com.liferay.portal.osgi.web.servlet.jsp.compiler.JspServlet.service(JspServlet.java:428)
Environment
- Liferay DXP 7.0
- Liferay DXP 7.1
Resolution
- You probably have the property direct.servlet.context.reload set to false (and you are probably working in a developing, non-prod environment, doing frequent redeployments of JSP fragment modules)
- Set the property to true.