Please help! Am I asking in the wrong forum?

I have now also tried with mod_jk (not mod_jk2) and it is the same problem:
as soon as I turn on Apache Includes the page stops working (but only when
it comes from Tomcat via mod_jk, it works perfectly in Tomcat).

Could someone using Apache2 and mod_jk installed (prefrebly mod_jk2) try
this jsp page with and without includes on (in Apache2) and tell me if it
works or not for them?

  <%@ page language="java" %>
  <html>
  <head>
    <title>Test</title>
  </head>
  <body>
  <pre>
  <%
     for (int i = 0; i < 5000; i++) {
        out.println("<table><tr><td>i = "+i+"</td></tr></table>");
     }
  %>
  </pre>
  </body>
  </html>

Just put it in Tomcat's examples/jsp folder and add the following lines to
Apache Httpd2 conf file.

  <Location "/examples/">
      SetOutputFilter Includes
  </Location>

If I do it IE the browser tries to reload the page a couple of times before
saying "The page cannot be displayed" Opera displays a page which is
corrupted.

I have been trying to figure out if it is the Httpd includes (which works
fine for everything except stuff from Tomcat) or the jk connection (which
works fine as long as Includes are off) that is at fault here but getting
nowhere...


Thanks in advance
/Olle


> -----Original Message-----
> From: Olle Sundblad [mailto:[EMAIL PROTECTED]
> Sent: den 29 juli 2003 17:05
> To: [EMAIL PROTECTED]
> Subject: mod_jk2 combined with mod_include bug?
>
>
> Hi,
>
> 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"
> "DTD/xhtml1-transitional.dtd">
>   <html>
>   <head>
>     <title>Test</title>
>     <meta http-equiv="content-type" content="text/html;
> charset=iso-8859-1"
> />
>   </head>
>   <body bgcolor="#ffffff">
>   <h1>Test</h1>
>   <pre>
>   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
>   table><tr><td>599</td></tr></table>
>   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
> random).
>
> 2. Avoid the bug (2 ways)
>   - Call the servlet directly from Tomcat -> everything works as expected
>   or
>   - 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
> this:
>
>       ...
>       992 <table><tr><td>992</td></tr></table>
>       993 <tabl<tr><td>9
>       1ff93</td><
>
>     where the newline is followed by "1ff" or this:
>
>       ...
>       4998 <table><tr><td>4998</td></tr></table>
>       4999 <table><tr><td>4
>       8
>       999</td>
>       26
>       </tr></table>
>
>       </pre>
>       </body>
>       </html>
>
>       0
>
> 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
> /Olle
>
>
> Relevant setup info (don't really know what is relevant so ask for more if
> needed):
>
> - 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 (binary download version)
>
>   in httpd.conf
>   <Location "/test/">
>     SetOutputFilter Includes
>   </Location>
>
> - Servlet source code
>
>   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "DTD/xhtml1-transitional.dtd">
>   <%@ page language="java" %>
>   <html>
>   <head>
>     <title>Test</title>
>     <meta http-equiv="content-type" content="text/html;
> charset=iso-8859-1"
> />
>   </head>
>   <body bgcolor="#ffffff">
>   <h1>Test</h1>
>   <pre>
>   <%
>      for (int i = 1; i < 5000; i++) {
>         out.print(i + " <table><tr><td>"+i+"</td></tr></table>\n");
>      }
>   %>
>   </pre>
>   </body>
>   </html>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to