• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to compile class for JSP?

belleyedan Manikandan
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm using Tomcat 5.0 standalone on port 80 with JDK1.4.0 on Windows 2000.
Tomcat serves static content just fine (directory listings, and the
/tomcat-docs pages). In addition, the servlets in /examples work just fine.

However, the JSPs in /examples, the index.jsp in ROOT, and a JSP I wrote for
a test all produce the same error:

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

An error occurred at line: -1 in the jsp file: null

Generated servlet error:
[javac] Compiling 1 source file
lors\colrs_jsp.java:104: handlePageException(java.lang.Exception) in
javax.servlet.jsp.PageContext cannot be applied to (java.lang.Throwable)
if (pageContext != null) pageContext.handlePageException(t);
1 error

I looked at the generated source of these files and the snippet that is
breaking is basically the try..catch that wraps the page code.

try {

/* get default jsp objects (session,application,out) */

/* do whatever the page is trying to do */

} catch (Throwable t) {
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null)

The Servet API says that PageContext.handlePageException() is overloaded for
both Throwable and Exception. Perhaps I have an old copy of servlet.jar
floating around that gets included in the CLASSPATH?

any ideas?

Daniel Rhoades
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the actual JSP page your trying to use.

Also, check your JAVA_HOME and CLASSPATH variables.

I would also deploy your test outside of the examples dir, create a new directory under localhost (I've never configured Tomcat in windows), or create a WAR
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic