Tomcat : The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit.
10:50:27,027 ERROR LogErrorInfoImpl:42 - Error Happen:
---------------20170221105027027.1001---------------
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 158 in the generated java file
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit.
因为JSP文件太大了导致此错误。
找到Tomcat安装目录下conf文件夹下的web.xml文件,在如下位置,添加红色字体的参数。
(D:\apache-tomcat-5.5.26\apache-tomcat-5.5.26\conf\web.xml)
<!-- The JSP page compiler and execution servlet, which is the mechanism -->
<!-- used by Tomcat to support JSP pages. Traditionally, this servlet -->
<!-- is mapped to the URL pattern "*.jsp". This servlet supports the -->
<!-- following initialization parameters (default values are in square -->
<!-- brackets): -->
<!-- -->
<!-- mappedfile Should we generate static content with one -->
<!-- print statement per input line, to ease -->
<!-- debugging? [true] -->
<!-- -->
<!-- If you wish to use Jikes to compile JSP pages: -->
<!-- Please see the "Using Jikes" section of the Jasper-HowTo -->
<!-- page in the Tomcat documentation. -->
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>enablePooling</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>mappedfile</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
之后重启Tomcat。
如果未解决 观察eclipse中Servers工程里面的web.xml
按如上方法维护 Tomcat安装目录下conf文件夹下的web.xml文件 和 eclipse中Servers工程里面的web.xml .