tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Mutsaers <>
Subject JSP: Exception inside create-bean is not handled correctly
Date Tue, 01 May 2001 13:27:12 GMT
Using Tomcat 3.2: when an exception is raised in the constructor of a bean (<jsp:usebean>)
the Exception is transformed by the JSP/Serlvet engine into a ServletException.

What is lacking is that the RootCause is not set (constructor public ServletException(java.lang.Throwable
rootCause) should be used).

Part of the generated servlet:

try {
  connections = (common.DbConnection) Beans.instantiate(this.getClass().getClassLoader(),
} catch (Exception exc) {
  throw new ServletException (" Cannot create bean of class "+"common.DbConnection");

The ServletException constructor should include exc as second argument.

This applies to many more places, and also when printing the ServletException stacktrace (in
the servlet engine), the getRootCasue() should be used to print information on the original
Exception as well.

Has this been fixed in later releases?

Peter Mutsaers

View raw message