Bug 41020 - Poor error msg when using errorReportValveClass in Host element
Summary: Poor error msg when using errorReportValveClass in Host element
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.0.20
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2006-11-22 11:19 UTC by Veit Guna
Modified: 2006-11-23 14:37 UTC (History)
0 users

Patch to add stracktrace to logging (728 bytes, patch)
2006-11-22 12:05 UTC, Veit Guna
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Veit Guna 2006-11-22 11:19:56 UTC
I'm using errorReportValveClass to set a custom Error-Page Handler. I've
implemented the Valve interface and placed the compiled class (with package
structure of course) to the server/classes dir. Tomcat just prints the following
poor message to the log (also with DEBUG level set):

Couldn't load specified error report valve class: <fullclassname>

That is too less information about the real problem. Couldn't it be found?
Couldn't it be instanciated? Stacktrace or similar would be helpful. 

Also the documentation ist poor:


Nothing mentioned about where to put the custom Valve class.
Comment 1 Veit Guna 2006-11-22 11:49:17 UTC
Please update the documentation.

           if(!found) {          	
                 Valve valve = (Valve) Class.forName(errorReportValveClass)
               errorReportValveObjectName = ((ValveBase)valve).getObjectName() ;

It seems that one has to extend ValveBase - not just implemented the Valve
Comment 2 Veit Guna 2006-11-22 12:05:49 UTC
Created attachment 19162 [details]
Patch to add stracktrace to logging

This will add the stacktrace to the logger when an error occurs while setting
the errorReportValveClass on Host configuration.
Comment 3 Veit Guna 2006-11-22 12:08:02 UTC
The patch is against the 5.5.20 version.
Comment 4 Mark Thomas 2006-11-23 14:37:02 UTC
The log message patch has been applied to SVN. Rather than amend the docs, I
rewrote the code to remove the requirement to extend ValveBase.

This fix will be in 5.5.21 onwards.