JSP with many tags reaches method size limit and fails to compile when moving to Tomcat 8.0.37 or later
Issue
- We have some JSP(s) with hundreds of tags on prior versions of Tomcat but after moving to Tomcat 8.0.37+, the JSP(s) can no longer compile:
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
Environment
- JBoss Web Server (JWS) 5.x
- Tomcat 9.0.x
- Tomcat 8.0.37+
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.