You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dan Gabdullin <da...@texrus.com> on 2002/04/06 08:14:31 UTC
Tomcat corrupts file during download
We have Standalone Tomcat 4.0 installed.
When our server was directly connected to cable modem and had only one
IP address X.X.X.X Tomcat worked fine. Problems appeared after we
installed a new router. After router installation, the server got 2 IP
addresses X.X.X.X (external, associated with the domain name) and
Y.Y.Y.Y (LAN address). To locate the source of the problem we used a
100Mb zip archive and download it using "http://server_ip/test.zip" URL.
When we address Tomcat via internal address Y.Y.Y.Y, it works fine. The
files are downloaded corrupted, if the Tomcat is addressed from the LAN
via the external address X.X.X.X. The first supposition is that the
files get corrupted by the router. We tried downloading that file at the
same address via Microsoft Internet Information Server 5.0, which is
installed at port 81. The file was downloaded without any problems. We
stopped Tomcat and ran Apache - the file was also downloaded without
problems. Taking into account all said above, we decided that the
problem is not in the router.
Perhaps the problem is not completely in Tomcat, but the situation when
in equal conditions IIS and Apache work fine and Tomcat creates problems
speaks to itself.
Best regards,
Dan
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
RE: Tomcat corrupts file during download
Posted by Dan Gabdullin <da...@texrus.com>.
>Are you downloading the file with a jsp page? It should be noted that
if
>you write to the output stream of a jsp page:
>[HttpServletResponse/ServletResponse.getOutputStream()], then the
output
>stream returned is a character output stream and will mangle binary
files
>and not handle all output correctly.
>Just thought I would point that out since it gave me some serious
>headaches.
Thank you, but it is not the case with me. I just put the file into the
root webapp and try to download it using the http://serverip/filename
string in the browser address bar.
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
Re: Tomcat corrupts file during download
Posted by Matt Gregory <ma...@skyleach.com>.
Are you downloading the file with a jsp page? It should be noted that if
you write to the output stream of a jsp page:
[HttpServletResponse/ServletResponse.getOutputStream()], then the output
stream returned is a character output stream and will mangle binary files
and not handle all output correctly.
Just thought I would point that out since it gave me some serious headaches.
----- Original Message -----
From: "Dan Gabdullin" <da...@texrus.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Saturday, April 06, 2002 5:55 AM
Subject: RE: Tomcat corrupts file during download
> Hello
>
> >If this problem indeed exists, then it is a JVM problem. Tomcat
> obviously
> >can't make a difference it is sending bytes on the LAN or on a WAN, and
> >doesn't do anything unusal when it comes to bytes output.
> >That being said, some people are actually using TC on the internet
> without
> >corruption or any problem, so I think even if you think it is not your
> >fault, it is a configuration issue on your side. I'm regularly closing
> bug
> >4668 for that reason.
> When I use Tomcat from the Internet I don't have the problem with
> corruption either. The bug appears only when I connect from the LAN to
> the server in the same network using Tomcat's WAN IP address. This is
> not a common situation and it doesn't really spoil the work. I can
> always connect using LAN server IP address. But the bug is in Tomcat for
> sure. I used IIS and Apache and no problems appeared. I tried to use
> Jetty, which is 100% pure Java HTTP server, and it didn't corrupt the
> file either, so the problem is not in JVM.
> I don't think that the problem lies in network configuration. In such a
> case none of the above servers would have worked.
>
> Best regards,
> Dan
>
>
> --
> To unsubscribe: <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
RE: Tomcat corrupts file during download
Posted by Dan Gabdullin <da...@texrus.com>.
Hello
>If this problem indeed exists, then it is a JVM problem. Tomcat
obviously
>can't make a difference it is sending bytes on the LAN or on a WAN, and
>doesn't do anything unusal when it comes to bytes output.
>That being said, some people are actually using TC on the internet
without
>corruption or any problem, so I think even if you think it is not your
>fault, it is a configuration issue on your side. I'm regularly closing
bug
>4668 for that reason.
When I use Tomcat from the Internet I don't have the problem with
corruption either. The bug appears only when I connect from the LAN to
the server in the same network using Tomcat's WAN IP address. This is
not a common situation and it doesn't really spoil the work. I can
always connect using LAN server IP address. But the bug is in Tomcat for
sure. I used IIS and Apache and no problems appeared. I tried to use
Jetty, which is 100% pure Java HTTP server, and it didn't corrupt the
file either, so the problem is not in JVM.
I don't think that the problem lies in network configuration. In such a
case none of the above servers would have worked.
Best regards,
Dan
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
Re: Tomcat corrupts file during download
Posted by Remy Maucherat <re...@apache.org>.
> We have Standalone Tomcat 4.0 installed.
> When our server was directly connected to cable modem and had only one
> IP address X.X.X.X Tomcat worked fine. Problems appeared after we
> installed a new router. After router installation, the server got 2 IP
> addresses X.X.X.X (external, associated with the domain name) and
> Y.Y.Y.Y (LAN address). To locate the source of the problem we used a
> 100Mb zip archive and download it using "http://server_ip/test.zip" URL.
> When we address Tomcat via internal address Y.Y.Y.Y, it works fine. The
> files are downloaded corrupted, if the Tomcat is addressed from the LAN
> via the external address X.X.X.X. The first supposition is that the
> files get corrupted by the router. We tried downloading that file at the
> same address via Microsoft Internet Information Server 5.0, which is
> installed at port 81. The file was downloaded without any problems. We
> stopped Tomcat and ran Apache - the file was also downloaded without
> problems. Taking into account all said above, we decided that the
> problem is not in the router.
> Perhaps the problem is not completely in Tomcat, but the situation when
> in equal conditions IIS and Apache work fine and Tomcat creates problems
> speaks to itself.
If this problem indeed exists, then it is a JVM problem. Tomcat obviously
can't make a difference it is sending bytes on the LAN or on a WAN, and
doesn't do anything unusal when it comes to bytes output.
That being said, some people are actually using TC on the internet without
corruption or any problem, so I think even if you think it is not your
fault, it is a configuration issue on your side. I'm regularly closing bug
4668 for that reason.
Remy
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>