tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger Roger" <rxt...@gmail.com>
Subject HTTP 500 when using custom error pages in Tomcat 6.0
Date Tue, 05 Jun 2007 12:23:00 GMT
Hi there,

Recently we upgraded to Tomcat 6.0. Suddenly the custom errorpages don't
work anymore. For this test I created a simple jsp-page with <%=x%> in it
without declaring that x so it would result in an error. I would like to
know how I can get the customized page (error.jsp) back.

#################################
test.jsp
#################################
<%@ page errorPage="error.jsp" %>

<html>
<body>
<h1>Error test page</h1>
<%=x%>
</body>
</html>

#################################
error.jsp
#################################

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
">
<html>
<body>
      <h1>Error message</h1>
      <p>Something went wrong!</p>
      <div><%= exception.getMessage () %></div>
</body>
</html>


#################################
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: 6 in the jsp file: /error/errormessage.jsp
x cannot be resolved
3: <html>
4: <body>
5: <h1>Error test page</h1>
6: <%=x%>
7: </body>
8: </html>


Stacktrace:
      org.apache.jasper.compiler.DefaultErrorHandler.javacError(
DefaultErrorHandler.java:92)
      org.apache.jasper.compiler.ErrorDispatcher.javacError(
ErrorDispatcher.java:330)
      org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java
:423)
      org.apache.jasper.compiler.Compiler.compile (Compiler.java:308)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
      org.apache.jasper.JspCompilationContext.compile(
JspCompilationContext.java:566)
      org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:317)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:320)
      org.apache.jasper.servlet.JspServlet.service (JspServlet.java:266)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

After repeated refreshes, I sometimes get the following error:

#################################
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 : org.apache.jasper.JasperException:
Unable to load class for JSP
      org.apache.jasper.servlet.JspServletWrapper.getServlet(
JspServletWrapper.java:156)
      org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java :329)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:320)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
      javax.servlet.http.HttpServlet.service(HttpServlet.java :803)

root cause

org.apache.jasper.JasperException: Unable to load class for JSP
      org.apache.jasper.JspCompilationContext.load(
JspCompilationContext.java:600)
      org.apache.jasper.servlet.JspServletWrapper.getServlet (
JspServletWrapper.java:144)
      org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:329)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:320)
      org.apache.jasper.servlet.JspServlet.service (JspServlet.java:266)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.ClassNotFoundException: org.apache.jsp.error.errormessage_jsp
      java.net.URLClassLoader$1.run (URLClassLoader.java:200)
      java.security.AccessController.doPrivileged(Native Method)
      java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
      org.apache.jasper.JspCompilationContext.load(
JspCompilationContext.java:598)
      org.apache.jasper.servlet.JspServletWrapper.getServlet (
JspServletWrapper.java:144)
      org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:329)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
:320)
      org.apache.jasper.servlet.JspServlet.service (JspServlet.java:266)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

Thanks for your input!

Roger

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message