hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ittay Dror <ittay.d...@gmail.com>
Subject Re: getting NoHttpResponseException("The target server failed to respond")
Date Tue, 04 Jan 2011 18:26:00 GMT


Oleg Kalnichevski wrote:
> "Ittay Dror"<ittay.dror@gmail.com>  wrote:
>
>>
>> Oleg Kalnichevski wrote:
>>> "Ittay Dror"<ittay.dror@gmail.com>   wrote:
>>>
>>>> Oleg Kalnichevski wrote:
>>>>> On Tue, 2011-01-04 at 17:30 +0200, Ittay Dror wrote:
>>>>>> It turns out this is because my warmupInput file was empty. The
>>>> server
>>>>>> responded with 100 (continue), but because the file was empty
>>>> nothing
>>>>>> was written to the output stream, so after a while there was a
>>>> timeout.
>>>>>> IMHO, this is a bug. Either an empty input should be posted, or I
>>>> should
>>>>>> get a more accurate error ("nothing to post")
>>>>>>
>>>>>> Ittay
>>>>>>
>>>>> The protocol interceptor responsible for generating 'expect:
>>>>> 100-continue' header does not add the header to messages with empty
>>>>> request bodies [1]. Feel free to doubled-check.
>>>>>
>>>>>
>> http://hc.apache.org/httpcomponents-core-ga/httpcore/xref/org/apache/http/protocol/RequestExpectContinue.html
>>>> Then the error message should reflect that. I also think it should
>> come
>>>> before the timeout. The server says to continue, the client doesn't
>>>> continue, so obviously the server will not process anything.
>>>>
>>>> Ittay
>>>>
>>>>
>>>>> Oleg
>>>>>
>>>>>
>>>>>
>>>>>
>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>>>>> For additional commands, e-mail:
>> httpclient-users-help@hc.apache.org
>>> Reflect what exactly? HttpClient does not generate 'expect' header
>> for empty messages as required by the http spec, so the server was not
>> meant to send 100 response in the first place.
>>
>> *if*  (entity !=*null*&&   entity.getContentLength() != 0) {
>>
>> in my case, i created the entity with length -1, as i don't know the
>> actual length.
>>
>>
>>> If you are still convinced HttpClient is at fault here please post a
>> complete wire/context log of the session. I will have a look at it.
>>> Oleg
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>>
> In which case HttpClent would use chunk coding to signal the end of the message body.
That means there would be at least a closing tag.

I don't know HttpClient like you, but once I put some content in the 
file everything works.
> Oleg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>

---------------------------------------------------------------------
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