Results 1 to 3 of 3
- 08-31-2010, 04:02 AM #1Member
- Join Date
- Aug 2010
- Rep Power
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding
I have tomcat 5.5.30 with jdk 1.4.2_21, and i have jsp file then when i hit it i found this error message :
Unable to compile class for JSP:
An error occurred at line: 163 in the generated java file
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
but when i used tomcat 4.1.30 with jdk 1.4.2_21, the problem didn't occur. Please help me what was going on.
Thank you in advance
- 08-31-2010, 06:05 AM #2
its possible the current version of tomcat jsp compiler (that is translating the .jsp page into .java file) is creating more chatter or verbose coding things, than the previous servlet spec, enough so that this is causing the total size of the stuff to be more than 64k, which is apparently an upper limit on the size of stuff that can go into a method (jsp page content goes into the body of the service() method )
And this amount of content was likely just within this threshold before and worked unnoticed.
Or that you now have more data than before.
You must have a very large page? I have never heard of this limit coming up from normal page use.
I can imagine this happening as the result of the <%@ include %> directive being done inside a for loop. where it is verbatim including that include file. in this case, try to use the <jsp:include> directive instead, as this performs a subroutine type of call out to the include instead of stuffing it verbatim into the generated servlet.
or perhaps database results rendered inside a for loop. in which case, also try a jsp:include for each row of results, or perhaps limit the size of data using pagination techniques.
- 08-31-2010, 11:02 AM #3Moderator
- Join Date
- Apr 2009
- Rep Power
The actual data being processed shouldn't have an effect, as that won't affect the size of code produced by Tomcat. That is, the amount of data returned by a database call is irrelevant.
Similarly, a loop with a <%@ include %> inside it should have no effect, at least not any different to an include outside a loop. It will only be included once in the generated code, inside the supplied loop.
So essentially, I would say their JSP page is faaaaaar too much of a monster and should have been borken down, using <jsp:include> as you suggest.
- By sumved.shami in forum Java ServletReplies: 4Last Post: 02-02-2012, 05:58 AM
- By holyjohn in forum Advanced JavaReplies: 6Last Post: 06-24-2010, 08:45 AM
- By Java Tip in forum Java TipReplies: 0Last Post: 01-28-2008, 10:00 AM
- By iimasd in forum AWT / SwingReplies: 0Last Post: 11-06-2007, 07:58 AM
- By Ed in forum Java ServletReplies: 2Last Post: 07-02-2007, 03:02 PM