tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olle Sundblad" <>
Subject Coyote - httpd mod_include bug?
Date Tue, 29 Jul 2003 14:17:08 GMT

I dont't know if this is the right forum? If it is not please tell me were
to send it.

I have this bug that I (on and off) have been trying to track down for a
couple of months now.

It only occurs when I forward calls from Apache2 to Tomcat and has the the
Apache2 Includes filter turned on. I get the same result on Win2k
Professional, Win2k Server, and Win2003 Server (I have also reinstalled
everything on three different machines just to check:-).

What I do to get/avoid the "bug"

1. Get the bug:
  - Call the jsp page (listed below) through Apache2 which forwards it to
Tomcat and return it to Apache2 which has the includes filter on
(SetOutputFilter Includes). The error occurs even when not using any include
statments (as in the sample servlet).
  Sample output from such a call:

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"
  <body bgcolor="#ffffff">
  1 <table><tr><td>1</td></tr></table>
  2 <table><tr><td>2</td></tr></table>
  598 <table><tr><td>598</td></tr></table>
  599 <                                         <- unexpected newline here
  600 <table><tr><td>600</td></tr></table>
  797 <table><tr><td>797</td></tr></table>
  798 <table><tr><td>798</td><                  <- unexpected
newline here
again (then the
                                                   web-browser (Opera) stop
receiving (IE Crash))

  The errors occurs in the same places if I reload the page (or even restart
the machine). But any change to the JSP page move the errors (seemingly at

2. Avoid the bug (2 ways)
  - Call the servlet directly from Tomcat -> everything works as expected
  - Turn off the Apache2 Includes filter -> everything works as expected

3. (Maybe) Interesting finds
  - If I cut the resulting page from Tomcat's output and place it as a
static page on the Apache2 server. It outputs it correctly (even with
includes) on without any "bonus" new lines. So it is only when the page
comes from Tomcat (mod_jk2) that the includes fail.
  - Also all static pages with includes work fine as do a number of servlets
and jsp pages (I think the length of the page may have something to do with
it since all shorter pages seem to work fine). So maybe it is a buffer
problem I actually tried looking at some source code (in both Apache2 and
Coyote) but gave up since I don't even know were to start...
  - Also on one servlet I removed all uses of includes and it started
working (but it might have been just luck the newlines in allowed places).
  - Sometimes I get other characters (than newlines) as well for example

      992 <table><tr><td>992</td></tr></table>
      993 <tabl<tr><td>9

    where the newline is followed by "1ff" or this:

      4998 <table><tr><td>4998</td></tr></table>
      4999 <table><tr><td>4



Has anyone encoutered this or have a workaround for it (I would really like
to use the Httpd Includes on output form Tomcat).

Thanks in advance

Relevant setup info (don't really know what is relevant so ask for more if

- Apache Tomcat/4.1.24 (binary download version)

- Apache 2.0.44 (Win32) mod_jk2/2.0.2 (binary download version)
  with mod_jk2-2.0.43.dll (added to modules) don't know why Apache Service
Monitor says 2.0.2

  in httpd.conf
  <Location "/test/">
    SetOutputFilter Includes

- Servlet source code

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  <%@ page language="java" %>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"
  <body bgcolor="#ffffff">
     for (int i = 1; i < 5000; i++) {
        out.print(i + " <table><tr><td>"+i+"</td></tr></table>\n");

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message