aspose file tools*
The moose likes JSP and the fly likes Error : The code of method _jspService(...) is exceeding the 65535 bytes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Error : The code of method _jspService(...) is exceeding the 65535 bytes" Watch "Error : The code of method _jspService(...) is exceeding the 65535 bytes" New topic
Author

Error : The code of method _jspService(...) is exceeding the 65535 bytes

sandeep kapse
Greenhorn

Joined: Jun 07, 2007
Posts: 25
Hi,
I got following error when I was accessing a JSP page, which is quite a big:

Error Page by Tomcat 5 :
------------------------------------------------------------------------------------------

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP:


An error occurred at line: 29 in the generated java file
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit

Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:319)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
com.filters.LoggingFilter.doFilter(LoggingFilter.java:35)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs.
Apache Tomcat/5.5.28
----------------------------------------------------------------------------------------------------------------

What it is exactly? I got such kind of error first time.
Can anybody help for a solution?

Thanks.
-Sandeep.

[ SCJP6, SCWCD5 ]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12788
    
    5
It means what it says. You have put so much code in that method that it is running into the strict JVM limit on method size.

Solution: break up the code into separate methods and/or methods in utility objects.

Bill
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

Or, step out of 2002 and start using JSPs the way that they are intended, as view components with no processing code within them.

This article might help.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sandeep kapse
Greenhorn

Joined: Jun 07, 2007
Posts: 25
Ok.
But why there is limit in JVM on method size?

Thanks
-Sandeep.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

That is not a JSP question. I suggest asking it in the Java General forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error : The code of method _jspService(...) is exceeding the 65535 bytes