Bug 41020 - Poor error msg when using errorReportValveClass in Host element
Poor error msg when using errorReportValveClass in Host element
Status: RESOLVED FIXED
Product: Tomcat 5
Classification: Unclassified
Component: Catalina
5.0.20
Other other
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2006-11-22 11:19 UTC by Veit Guna
Modified: 2006-11-23 14:37 UTC (History)
0 users



Attachments
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:

http://tomcat.apache.org/tomcat-5.5-doc/config/host.html

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.

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

It seems that one has to extend ValveBase - not just implemented the Valve
interface.
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.