Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to compile class for JSP

 
Ramna Reddy
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers,
Iam getting this problem quite frequently...some jsp files in my application are not able to compile as the code increases...throws the following exception.
Please provide some permanent solution.
Thank you all of you in advance.



org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit..

at
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
at
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java class files have several limits they need to obey, like number of methods and code size in bytes of all methods. The permanent solution would be to redesign your JSP so that it doesn't include so much code. It's considered bad design to keep Java code in a JSP anyway.
 
Ramna Reddy
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's considered bad design to keep Java code in a JSP anyway.

Iam not using any java code in jsp, but it has lot of struts-tags.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know some people have been able to get around this by breaking up their JSPs
and pasting them together at run time with jsp:include actions.

I'm going to move this to our Struts forum where you can get better advice on best practices for Struts apps.
 
Alaa Nassef
Ranch Hand
Posts: 471
Hibernate Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:

I'm going to move this to our Struts forum where you can get better advice on best practices for Struts apps.


Actually, this has nothing to do with struts.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic