You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacob Shukert <Ja...@WCom.com> on 2001/04/05 20:40:55 UTC

Header lines appearing in body after redirect with IIS.

Hi,

After I changed to using IIS instead of Tomcat's built-in web server, I
encountered the following problem:

I request a web page that redirects to a second web page after writing some
output.  The resulting web page contains this initial output plus the
following header fields plus the web page that I was redirected to:

HTTP/1.1 200 OK
Server: Microsoft-IIS/4.0
Date: Thu, 05 Apr 2001 18:19:38 GMT
Connection: close
Content-Type:text/html
Pragma:no-cache
Cache-Control:no-cache
Expires:Thu, 01 Jan 1970 00:00:00 GMT
Servlet-Engine:Tomcat Web Server/3.2.1 (JSP 1.1; Servlet 2.2; Java 1.2.2;
Windows NT 4.0 x86; java.vendor=Sun Microsystems Inc.)


I know that I can't write output before redirecting, but the output should
have stayed in the buffer and then been cleared when I tried to redirect.
This is what appears to be happening with Tomcat's built-in web server, in
which case everything appears to be ok.  In any case, I think I would have
gotten an error if I had sent the output back to the client before
redirecting.  I tried setting the <%@page buffer="64k"%> (or "64kb"), but
this didn't do anything and I know that I didn't have 64k of text in the
buffer.

Has anyone else encountered anything similar to this?

Thank you for any help.


Jacob Shukert
Jacob.Shukert@WCom.com
(703) 341-2751, VNET 235-2751
Source Systems Development
MCI WorldCom


Re: IE problem or tomcat bug?

Posted by Sam Newman <sa...@stamplets.com>.
We've seen the same version of MS products working very differently on
different OS's. Because allot of the abilities of win32 programs are
fullfilled by the inderlying win32 API's, ther're often subject to change
between different operating systems due to slightly different underlying
API's

The only way I could see the client causing a problem is byscrewing up the
request somehow, and it isn't being properly handled. You might want to
check the Apache logs and well as the tomcat logs. See if there are any
strange messages in access.log for example. I take it the problem context
hash debuing turned on? I would still suggest droping the mod_jk developers
a line, at least they can add it to thier bug database.

sam
----- Original Message -----
From: "Michael Stacey" <mi...@lexi.com>
To: <to...@jakarta.apache.org>
Sent: Wednesday, April 18, 2001 1:04 PM
Subject: Re: IE problem or tomcat bug?


> At 07:59 AM 4/18/01, you wrote:
> >I've not seen this before. You might want to try contacting the
developers
> >of mod_jk (I take it your using this if your using ajpv13?) directly. Its
> >always a pain when you can't reproduce these kind of problems. Are all of
> >the problems based around the same version of IE? Which browser do you
> >yourself use?
> >
> >sam
>
> Looks like different versions of IE all have the same problem.  To make
> matters worse, the same version of IE works fine on some computers but
> not others.  We have tested IE versions from 4.0 up and none have the
> problem in our tests.  We're assuming it may be an interaction between
> various MS programs (outlook, etc) on the client end.  Netscape users
> never experience the problem.
>
> Thanks for the response.
>
>
> -- Michael
>
>


Re: IE problem or tomcat bug?

Posted by Michael Stacey <mi...@lexi.com>.
At 07:59 AM 4/18/01, you wrote:
>I've not seen this before. You might want to try contacting the developers
>of mod_jk (I take it your using this if your using ajpv13?) directly. Its
>always a pain when you can't reproduce these kind of problems. Are all of
>the problems based around the same version of IE? Which browser do you
>yourself use?
>
>sam

Looks like different versions of IE all have the same problem.  To make
matters worse, the same version of IE works fine on some computers but
not others.  We have tested IE versions from 4.0 up and none have the
problem in our tests.  We're assuming it may be an interaction between
various MS programs (outlook, etc) on the client end.  Netscape users
never experience the problem.

Thanks for the response.


-- Michael 



Re: IE problem or tomcat bug?

Posted by Sam Newman <sa...@stamplets.com>.
I've not seen this before. You might want to try contacting the developers
of mod_jk (I take it your using this if your using ajpv13?) directly. Its
always a pain when you can't reproduce these kind of problems. Are all of
the problems based around the same version of IE? Which browser do you
yourself use?

sam
----- Original Message -----
From: "Michael Stacey" <mi...@lexi.com>
To: <to...@jakarta.apache.org>
Sent: Wednesday, April 18, 2001 12:15 PM
Subject: IE problem or tomcat bug?


> We've recently moved to a tomcat/apache server under linux using the
> most recent release builds.  Some of our clients are experiencing
> strange behavior, like getting the following stack trace to their
> browser:
>
> Tomcat.core.ContextManager.internalService(ContextManager.java:797) at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at
>
org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection
(Ajp13ConnectionHandler.java:160)
> at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(THreadPool.java:498)
> at java.lang.Thread.Run(Thread.java:484)
>
>
> (may be incomplete; sent by a client in email since we cannot duplicate
> the problem)
>
> The common thread seems to be that they're using IE as the browser.  Is
> this a known problem (thought I couldn't find it in the archives)?  Is
> there some workaround?  Would backing off to ajp12 fix it (we never had
> the problem with apache/jserv on NT)?
>
> Thanks for any suggestions.
>
> -- Michael
>
>


IE problem or tomcat bug?

Posted by Michael Stacey <mi...@lexi.com>.
We've recently moved to a tomcat/apache server under linux using the
most recent release builds.  Some of our clients are experiencing
strange behavior, like getting the following stack trace to their
browser:

Tomcat.core.ContextManager.internalService(ContextManager.java:797) at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at
org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection(Ajp13ConnectionHandler.java:160) 
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(THreadPool.java:498)
at java.lang.Thread.Run(Thread.java:484)


(may be incomplete; sent by a client in email since we cannot duplicate
the problem)

The common thread seems to be that they're using IE as the browser.  Is
this a known problem (thought I couldn't find it in the archives)?  Is
there some workaround?  Would backing off to ajp12 fix it (we never had
the problem with apache/jserv on NT)?

Thanks for any suggestions.

-- Michael 



RE: Header lines appearing in body after redirect with IIS.

Posted by Jacob Shukert <Ja...@WCom.com>.
Hi Shanti,

That worked!  Thank you very much.

Jacob Shukert
Jacob.Shukert@WCom.com
(703) 341-2751, VNET 235-2751
Source Systems Development
MCI WorldCom

-----Original Message-----
From: Guntupalli Shanti [mailto:sguntupa@cisco.com]
Sent: Thursday, April 05, 2001 2:56 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: Header lines appearing in body after redirect with IIS.


Hi Jacob,

I had the same problem...but only with IE, with Netscape it was fine.
In my case, the connection was kept alive and the output is
appended to the response buffer whenever I use sendRedirect method.
I added the following line to my code before reading anything
from response object (best place would be at the beginning of the Service
method).

response.setHeader("Connection","close")

I don't know if this is of any help in your case as the Connection appears
to be closed
from the Headers you have given

Cheers,
Shanti

At 02:40 PM 4/5/2001 -0400, you wrote:
>Hi,
>
>After I changed to using IIS instead of Tomcat's built-in web server, I
>encountered the following problem:
>
>I request a web page that redirects to a second web page after writing some
>output.  The resulting web page contains this initial output plus the
>following header fields plus the web page that I was redirected to:
>
>HTTP/1.1 200 OK
>Server: Microsoft-IIS/4.0
>Date: Thu, 05 Apr 2001 18:19:38 GMT
>Connection: close
>Content-Type:text/html
>Pragma:no-cache
>Cache-Control:no-cache
>Expires:Thu, 01 Jan 1970 00:00:00 GMT
>Servlet-Engine:Tomcat Web Server/3.2.1 (JSP 1.1; Servlet 2.2; Java 1.2.2;
>Windows NT 4.0 x86; java.vendor=Sun Microsystems Inc.)
>
>
>I know that I can't write output before redirecting, but the output should
>have stayed in the buffer and then been cleared when I tried to redirect.
>This is what appears to be happening with Tomcat's built-in web server, in
>which case everything appears to be ok.  In any case, I think I would have
>gotten an error if I had sent the output back to the client before
>redirecting.  I tried setting the <%@page buffer="64k"%> (or "64kb"), but
>this didn't do anything and I know that I didn't have 64k of text in the
>buffer.
>
>Has anyone else encountered anything similar to this?
>
>Thank you for any help.
>
>
>Jacob Shukert
>Jacob.Shukert@WCom.com
>(703) 341-2751, VNET 235-2751
>Source Systems Development
>MCI WorldCom


Re: Header lines appearing in body after redirect with IIS.

Posted by Guntupalli Shanti <sg...@cisco.com>.
Hi Jacob,

I had the same problem...but only with IE, with Netscape it was fine.
In my case, the connection was kept alive and the output is
appended to the response buffer whenever I use sendRedirect method.
I added the following line to my code before reading anything
from response object (best place would be at the beginning of the Service 
method).

response.setHeader("Connection","close")

I don't know if this is of any help in your case as the Connection appears 
to be closed
from the Headers you have given

Cheers,
Shanti

At 02:40 PM 4/5/2001 -0400, you wrote:
>Hi,
>
>After I changed to using IIS instead of Tomcat's built-in web server, I
>encountered the following problem:
>
>I request a web page that redirects to a second web page after writing some
>output.  The resulting web page contains this initial output plus the
>following header fields plus the web page that I was redirected to:
>
>HTTP/1.1 200 OK
>Server: Microsoft-IIS/4.0
>Date: Thu, 05 Apr 2001 18:19:38 GMT
>Connection: close
>Content-Type:text/html
>Pragma:no-cache
>Cache-Control:no-cache
>Expires:Thu, 01 Jan 1970 00:00:00 GMT
>Servlet-Engine:Tomcat Web Server/3.2.1 (JSP 1.1; Servlet 2.2; Java 1.2.2;
>Windows NT 4.0 x86; java.vendor=Sun Microsystems Inc.)
>
>
>I know that I can't write output before redirecting, but the output should
>have stayed in the buffer and then been cleared when I tried to redirect.
>This is what appears to be happening with Tomcat's built-in web server, in
>which case everything appears to be ok.  In any case, I think I would have
>gotten an error if I had sent the output back to the client before
>redirecting.  I tried setting the <%@page buffer="64k"%> (or "64kb"), but
>this didn't do anything and I know that I didn't have 64k of text in the
>buffer.
>
>Has anyone else encountered anything similar to this?
>
>Thank you for any help.
>
>
>Jacob Shukert
>Jacob.Shukert@WCom.com
>(703) 341-2751, VNET 235-2751
>Source Systems Development
>MCI WorldCom