hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: making a client for downloading file through http
Date Fri, 06 Nov 2009 15:57:05 GMT
Håkon Sagehaug wrote:
> Hi Oleg
> 
> see inline
> 
> 2009/11/6 Oleg Kalnichevski <olegk@apache.org>
> 
>> Håkon Sagehaug wrote:
>>
>>> Hi Oleg
>>>
>>> Thanks for the tips, I think I'll go for the classic way. I followed the
>>> [1]
>>> instroduction and I guess thats a good starting point.
>>>
>>>
>> Hi Håkon
>>
>> Make sure you have also read this tutorial:
>>
>> http://hc.apache.org/httpcomponents-core/tutorial/html/index.html
> 
> Yes, I've actually looked at this also
> 
>>
>>
>>  I get sometimes this error
>>> org.apache.http.NoHttpResponseException: The target server failed to
>>> respond
>>>
>>> Waht can i do to avoid this, is it a timeout isssue. My code is mroe or
>>> less
>>> that same setup as shown in [1].
>>>
>>>
>> HttpCore throws this exception if the target server fails to return _any_
>> response of what so ever and prematurely terminates the connection. This can
>> happen, for instance, when the target server is being under heavy load and
>> is unable to allocate a worker for a new connection, or due to unexpected
>> error in the request processing code. However, there can be no 100%
>> certainty about that. Usually the server logs is the only definitive source
>> of information about that kind of problems.
>>
> The strange thing is that if I used HTTPClient for the job of downloading I
> don't seem to have the problem. So just wondering if there where some
> parameters one have to set in the http-core that is set in the http-client
> component. But I can check the server logs also
> 

There is no special parameter. HttpClient simply employs a retry handler 
to re-try such requests automatically:

http://hc.apache.org/httpcomponents-client/tutorial/html/fundamentals.html#d4e280

Oleg

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message