Unable to compile class for JSP:
An error occurred at line: [186] in the generated java file: [D:\project\sample\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\work\Catalina\localhost\sampleProject\org\apache\jsp\folder01\folder02\...\sample_jsp.java]
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
위와 같은 메시지가 나온다. 참고로 .metadata 는 서버가동시 tomcat 이 실제로 리소스를 읽는 경로이다.
위 경로를 잘 따라가면 그대가 작성한 jsp 파일이 모셔져 있는 것을 확인할 수 있다.
jsp 파일이 읽을 수 있는 65535byte, 즉 64kb 를 초과해서 발생하는 오류이다.
Tomcat => web.xml 파일 => <servlet> 태그에 jsp파일크기를 제한하지 않도록 요소를 추가한다.
<!-- =======생략====== -->
<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>mappedfile</param-name>
<param-value>false</param-value>
</init-param>
<!--=====추가끝=====-->
<load-on-startup>3</load-on-startup>
</servlet>
<!-- =======생략====== -->
Tomcat을 재시작한다.
'웹 개발 > 설정 및 오류해결' 카테고리의 다른 글
[eclipse error] com.microsoft.sqlserver.jdbc.SQLServerException (0) | 2022.09.03 |
---|---|
[웹 설정] 톰캣(tomcat) server.xml 설정하기 (1) | 2022.07.16 |
[JSP] cos.jar 를 이용하여 eclipse 에서 파일 업로드 기능 구현하기 (0) | 2021.07.01 |
[Eclipse] Data Source Explorer 이용하여 SQL 실행하기 (0) | 2021.06.26 |
[Eclipse] Data Source Explorer 이용하여 DB(MySQL) 연결하기 (update.2021-11-12) (0) | 2021.06.26 |