JSP Compilation Errors when Deploying Liferay Portal 6.2 on Apache Tomcat 7.0.75 (Or Higher)

This article documents a known issue when administrators deploy Liferay Portal 6.2 EE on Apache Tomcat 7.0.75 (or higher). An error will appear in the console (see truncated log below):

An error occurred at line: [430] in the generated java file: [/home/ugurcan/liferay/bundles/ee-6.2.x/tomcat-7.0.75/work/Catalina/localhost/_/org/apache/jsp/html/common/themes/portlet_jsp.java]
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit

Stacktrace:
	at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
	at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
	at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:490)

Feb 13, 2017 4:30:26 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.ClassNotFoundException: org.apache.jsp.html.common.themes.portlet_jsp
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
	at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)

16:30:26,920 ERROR [RuntimePageImpl-1][PortletRequestDispatcherImpl:131] org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.html.common.themes.portlet_jsp
org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.html.common.themes.portlet_jsp
	at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:177)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:376)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)

The issue is with the Jasper jar which is responsible for compiling JSP files. A newer version of Jasper was first released in Tomcat 7.0.75;  see Apache's documentation article 60356.

Resolution

Fixed in liferay-fixpack-portal-148-6210

Alternative Solution: Replace tomcat-7.0.75/lib/jasper.jar with an older version (for example, copy the jar file from tomcat-7.0.62).

Was this article helpful?
0 out of 1 found this helpful