Bug 50583 - Standard error pages (e.g.404) do not work if AccessLogValve is configured on webapp
Summary: Standard error pages (e.g.404) do not work if AccessLogValve is configured on...
Status: RESOLVED DUPLICATE of bug 50582
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.6
Hardware: PC Windows XP
: P2 regression (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2011-01-14 04:48 UTC by Konstantin Kolinko
Modified: 2011-01-15 14:35 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kolinko 2011-01-14 04:48:37 UTC
Steps to reproduce:
1. Configure AccessLogValve on the examples webapp:
E.g., create webapps/examples/META-INF/context.xml with the following content:

    <Valve className="org.apache.catalina.valves.AccessLogValve"
       directory="logs" prefix="examples_access_log." suffix=".txt"
       pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"/>

2. Start Tomcat and access

3. Expected result: Standard error 404 page provided by Tomcat.
Actual result: blank page.
If I use telnet to send the request, I see the following:
GET /examples/4 HTTP/1.1

HTTP/1.1 404 Not Found
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Date: Fri, 14 Jan 2011 09:32:30 GMT


If AccessLogValve is removed from META-INF/context.xml, the correct behaviour is restored. The presence of AccessLogValve in server.xml (as configured by default) does not trigger this issue.

I suspect that the cause might be the same as in bug 50582: a flush() performed by AccessLogValve.
Comment 1 Mark Thomas 2011-01-15 14:35:17 UTC
Root cause is the same

*** This bug has been marked as a duplicate of bug 50582 ***