Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
sandeep kapse
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64828
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sandeep kapse
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok.
But why there is limit in JVM on method size?

Thanks
-Sandeep.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64828
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is not a JSP question. I suggest asking it in the Java General forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic