Bug 36630 - Error instantiating servlet class
Error instantiating servlet class
Status: RESOLVED WORKSFORME
Product: Tomcat 5
Classification: Unclassified
Component: Catalina
5.5.9
Other All
: P2 major (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2005-09-13 07:04 UTC by bernard
Modified: 2007-02-27 18:33 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bernard 2005-09-13 07:04:40 UTC
"Error instantiating servlet class <servlet class name>"

This exception message is printed in the log file when a class used by a servlet
cannot be instantiated.

The developer will eventually be able to guess the class and add it to the
classes/jars directory under [install-dir]/shared/.

However, the class loader should print in its error message the name of the
class that it cannot find.

The curent error message is misleading, as the missing class NOT the servlet
class that is printed in the message.

How to reproduce:

- Write a servlet that uses a class that is not part of the JRE and not part of
the classes supplied by Tomcat.
- Try to load your servlet.
Comment 1 Yoav Shapira 2005-10-13 06:08:25 UTC
Hmm, I'm actually a little bit confused as to why ths happens.  If you look at
StandardWrapper line 1060 or so, the exception is properly thrown with the root
caused attached, so a full stack trace should print out.  I added a log.debug
statement to make sure the full stack trace is in the log anyways.
Comment 2 Thomas Leonard 2006-11-06 07:16:13 UTC
Perhaps this is the problem:

    public ServletException(String message, Throwable rootCause) {
	super(message);
	this.rootCause = rootCause;
    }

It's still in the latest svn revision (assuming this is the trunk):

http://svn.apache.org/repos/asf/tomcat/servletapi/servlet2.4-jsp2.0-tc5.x/jsr154/src/share/javax/servlet/ServletException.java

Comment 3 Mark Thomas 2007-02-27 18:33:57 UTC
I have tested this with the latest code from svn and the stack trace is
displayed as expected.