You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by tr...@moja.mine.nu on 2004/06/04 15:56:40 UTC
Download of file causes connection breakdown with debugging off
Hello everybody,
I found the following problem:
With my Web-App ( Bea 6.1 / struts ) I wanted (in fact had to :-) download
a not so small file ( about 170k ) from a Microsoft IIS server from a partner
company using NTLM auth.
When the loglevel was set to debug everything worked fine using the
authentication as well as the method.getResponseBodyAsStream();.
As soon as I turned off logging, and the data going over the wire
was not printed in the logfile, I received only 1-4 IP-Packets
containing response data, then my machines decreased the receive
window to 0, and the server doesn't send ( correctly ) any more packages.
Tested on Linux and Solaris.
I now bypassed the problem by not using the method.getResponseBodyAsStream()
but getting the byte[] instead, and putting it into an appropriate
InputStream.
What could be the reason for this? When reading the input stream I had
to do lots of line-based parsing, did i let wait the stream too long,
means reading too slow? Did anyone else appear such a problem already?
Kind Regards,
Ralf Fischer
--
Ralf Fischer
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [HttpClient] Re: Download of file causes connection breakdown with debugging off
Posted by tr...@moja.mine.nu.
Hi,
I also would like to move to the Island Niue (somewhere close to
new zealand in the pacific ocean), also if there doesn't seem to be
much goin' on. I've never have been there =)
Here's an interesting story about this "where-the-hell-comes-this-
domain-from" topic:
http://www.theregister.co.uk/2004/01/15/niue_is_dead_long_live/
In fact moja.mine.nu is a dyndns-account, and I run my own
mailserver on the aliased box. I'm from germany :)
Ralf
On Thu, Jun 17, 2004 at 08:15:20AM -0700, Stephen Westbom wrote:
> Any jobs for Java developers there? We want to emigrate :)
>
> Never heard of your country before now.
>
> --- tripod@moja.mine.nu wrote:
> >
> > Hello Mike,
> >
> > sorry for responding so late, I was on holidays :-)
> >
> > Anyway you were right!
> >
> > The Problem was I took the InputStream from the method, released the
> > connection, and then returned the InputStream. Of course this will not
> > work.
> >
> > Thanks,
> > Ralf
> >
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [HttpClient] Re: Download of file causes connection breakdown with debugging off
Posted by Stephen Westbom <sw...@yahoo.com>.
Any jobs for Java developers there? We want to emigrate :)
Never heard of your country before now.
--- tripod@moja.mine.nu wrote:
>
> Hello Mike,
>
> sorry for responding so late, I was on holidays :-)
>
> Anyway you were right!
>
> The Problem was I took the InputStream from the method, released the
> connection, and then returned the InputStream. Of course this will not
> work.
>
> Thanks,
> Ralf
>
>
> On Sun, Jun 06, 2004 at 11:51:53PM -0400, Michael Becke wrote:
> > Hello Ralf,
> >
> > This sounds quite strange. The fact that calling getResponseBody()
> > fixes the problem leads me to believe that the responses were not being
> > fully processed. When executing a method you must be sure to call
> > HttpMethod.releaseConnection() or read the entire method response
> > (which implicitly calls HttpMethod.releaseConnection())). My guess is
> > that this was not happening. If you post some sample code of how you
> > are using HttpClient, along with a wire log
> > <http://jakarta.apache.org/commons/httpclient/logging.html> we will be
> > able to get a better idea of what's happening.
> >
> > Mike
> >
> > On Jun 4, 2004, at 9:56 AM, tripod@moja.mine.nu wrote:
> >
> > >Hello everybody,
> > >
> > >I found the following problem:
> > >
> > >With my Web-App ( Bea 6.1 / struts ) I wanted (in fact had to :-)
> > >download
> > >a not so small file ( about 170k ) from a Microsoft IIS server from a
> > >partner
> > >company using NTLM auth.
> > >
> > >When the loglevel was set to debug everything worked fine using the
> > >authentication as well as the method.getResponseBodyAsStream();.
> > >
> > >As soon as I turned off logging, and the data going over the wire
> > >was not printed in the logfile, I received only 1-4 IP-Packets
> > >containing response data, then my machines decreased the receive
> > >window to 0, and the server doesn't send ( correctly ) any more
> > >packages.
> > >Tested on Linux and Solaris.
> > >
> > >I now bypassed the problem by not using the
> > >method.getResponseBodyAsStream()
> > >but getting the byte[] instead, and putting it into an appropriate
> > >InputStream.
> > >
> > >What could be the reason for this? When reading the input stream I had
> > >to do lots of line-based parsing, did i let wait the stream too long,
> > >means reading too slow? Did anyone else appear such a problem already?
> > >
> > >Kind Regards,
> > > Ralf Fischer
> > >--
> > >Ralf Fischer
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
>
> --
> Ralf Fischer
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
=====
Your source for complex solutions to simple problems
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [HttpClient] Re: Download of file causes connection breakdown with debugging off
Posted by tr...@moja.mine.nu.
Hello Mike,
sorry for responding so late, I was on holidays :-)
Anyway you were right!
The Problem was I took the InputStream from the method, released the
connection, and then returned the InputStream. Of course this will not
work.
Thanks,
Ralf
On Sun, Jun 06, 2004 at 11:51:53PM -0400, Michael Becke wrote:
> Hello Ralf,
>
> This sounds quite strange. The fact that calling getResponseBody()
> fixes the problem leads me to believe that the responses were not being
> fully processed. When executing a method you must be sure to call
> HttpMethod.releaseConnection() or read the entire method response
> (which implicitly calls HttpMethod.releaseConnection())). My guess is
> that this was not happening. If you post some sample code of how you
> are using HttpClient, along with a wire log
> <http://jakarta.apache.org/commons/httpclient/logging.html> we will be
> able to get a better idea of what's happening.
>
> Mike
>
> On Jun 4, 2004, at 9:56 AM, tripod@moja.mine.nu wrote:
>
> >Hello everybody,
> >
> >I found the following problem:
> >
> >With my Web-App ( Bea 6.1 / struts ) I wanted (in fact had to :-)
> >download
> >a not so small file ( about 170k ) from a Microsoft IIS server from a
> >partner
> >company using NTLM auth.
> >
> >When the loglevel was set to debug everything worked fine using the
> >authentication as well as the method.getResponseBodyAsStream();.
> >
> >As soon as I turned off logging, and the data going over the wire
> >was not printed in the logfile, I received only 1-4 IP-Packets
> >containing response data, then my machines decreased the receive
> >window to 0, and the server doesn't send ( correctly ) any more
> >packages.
> >Tested on Linux and Solaris.
> >
> >I now bypassed the problem by not using the
> >method.getResponseBodyAsStream()
> >but getting the byte[] instead, and putting it into an appropriate
> >InputStream.
> >
> >What could be the reason for this? When reading the input stream I had
> >to do lots of line-based parsing, did i let wait the stream too long,
> >means reading too slow? Did anyone else appear such a problem already?
> >
> >Kind Regards,
> > Ralf Fischer
> >--
> >Ralf Fischer
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
--
Ralf Fischer
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
[HttpClient] Re: Download of file causes connection breakdown with debugging off
Posted by Michael Becke <be...@u.washington.edu>.
Hello Ralf,
This sounds quite strange. The fact that calling getResponseBody()
fixes the problem leads me to believe that the responses were not being
fully processed. When executing a method you must be sure to call
HttpMethod.releaseConnection() or read the entire method response
(which implicitly calls HttpMethod.releaseConnection())). My guess is
that this was not happening. If you post some sample code of how you
are using HttpClient, along with a wire log
<http://jakarta.apache.org/commons/httpclient/logging.html> we will be
able to get a better idea of what's happening.
Mike
On Jun 4, 2004, at 9:56 AM, tripod@moja.mine.nu wrote:
> Hello everybody,
>
> I found the following problem:
>
> With my Web-App ( Bea 6.1 / struts ) I wanted (in fact had to :-)
> download
> a not so small file ( about 170k ) from a Microsoft IIS server from a
> partner
> company using NTLM auth.
>
> When the loglevel was set to debug everything worked fine using the
> authentication as well as the method.getResponseBodyAsStream();.
>
> As soon as I turned off logging, and the data going over the wire
> was not printed in the logfile, I received only 1-4 IP-Packets
> containing response data, then my machines decreased the receive
> window to 0, and the server doesn't send ( correctly ) any more
> packages.
> Tested on Linux and Solaris.
>
> I now bypassed the problem by not using the
> method.getResponseBodyAsStream()
> but getting the byte[] instead, and putting it into an appropriate
> InputStream.
>
> What could be the reason for this? When reading the input stream I had
> to do lots of line-based parsing, did i let wait the stream too long,
> means reading too slow? Did anyone else appear such a problem already?
>
> Kind Regards,
> Ralf Fischer
> --
> Ralf Fischer
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org