_jspService is exceeding the 65535 bytes limit

setzamora picture setzamora · Mar 30, 2011 · Viewed 95.8k times · Source

So I'm dealing with a legacy servlet code that runs on Websphere 7 (JDK 6). Development environment setup uses Tomcat 6 (JDK 6).

  1. Why does it work on Websphere 7 and not in Tomcat 6?
  2. Is this something related to the application server?

If your answer is yes for no. 2, do you have a workaround for this on Tomcat 6 (JDK 6) aside from breaking down the code or using dynamic includes?

The schedule does not agree with changing static includes to dynamic includes primarily because most pages are coupled with the business model code including the main template of the app.

Answer

WhiteFang34 picture WhiteFang34 · Mar 30, 2011

It sounds like you're hitting a 64k method limit, probably due to how Tomcat builds a class out of your JSP. This page suggests changing your static includes like this:

<%@ include file="test.jsp" %>

To dynamic includes like this to avoid the issue:

<jsp:include page="test.jsp" />