Bug 41020

Summary: Poor error msg when using errorReportValveClass in Host element
Product: Tomcat 5 Reporter: Veit Guna <grave>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Severity: normal    
Priority: P2    
Version: 5.0.20   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: Patch to add stracktrace to logging

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.