File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to compile class for JSP

 
Ashley Patten
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Does anyone know how to go about fixing the error below; I have spent a good 12 hours trying to work it out.


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: 18 in the generated java file
The return type is incompatible with JspSourceDependent.getDependants()

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:321)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:257)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.jenkov.servlet.multipart.MultipartFilter.doFilter(MultipartFilter.java:93)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.33 logs.
Apache Tomcat/6.0.33
 
harib raghu
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this could be the result of the type cast error..u see the message RETURN TYPE NOT COMPATIBLE..and ..also a COMPILATION error..which means
there is some function parameter incompatibility or return type not in line with the assigned variable..
if you list the code it can help a bit..
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17616
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way you fix errors like that is to not put Java code in JSPs. We have better ways to do stuff like that now.

And besides, as you have discovered, it's a lot harder to debug coding errors when you use scriptlets. This wasn't a problem with JSPs - it was a problem with the Java code ON the JSP.
 
Ashley Patten
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your replies; I managed to get around this problem by using tomcat 5 rather than 6.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic