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: Randon "ProtocolException: The server failed to respond with a valid HTTP response" while executing the client request
Date Sun, 02 Sep 2012 20:18:30 GMT
On Sun, 2012-09-02 at 19:01 +0530, Ravi C Chamarthy wrote:
> Hi Oleg,
> 
> Thanks for your response !
> 
> I tried to capture the request/response using an HTTP Analyzer tool.
> In the response of the prior (in the one before this failed http request)
> http call, I see the Connection header attribute value set to 'close'.
> However, we indeed have the following explicit call to check stale
> connections, but still is is failing with a blank response.
> 

That basically supports my assertion. HttpClient closes the connection
based on 'close' value of the 'Connection' header and attempts to create
a new connection for the subsequent request. The server fails to handle
the incoming connection on its end and drops it without a valid
response. This still looks like a server issue to me.

Oleg   

> HttpConnectionParams.setStaleCheckingEnabled(params, true);
> 
>     <headers>
>       <requestheaders>
> 
> <header>POST /ibm/iis/isf/javahttp/checked/com.ibm.iis.isf.security.auth.AuthenticationService/login
>  HTTP/1.1</header>
>         <header>Content-Length: 1048</header>
>         <header>Content-Type: application/octet-stream</header>
>         <header>Host: hyddev15:80</header>
>         <header>Connection: Keep-Alive</header>
>         <header>User-Agent: Apache-HttpClient/IIS 4.2 (java 1.5)</header>
>         <header>Cookie: JSESSIONID=0000titWHhRyPYrO6sWcA0LST3C:-1</header>
>         <header>Cookie2: $Version=1</header>
>         <header>Authorization: Basic
> YXV0aF91c2VyXzI0NkZUT18wOmF1dGhfdXNlcl8yNDZGVE9fMA==</header>
>       </requestheaders>
>       <responseheaders>
>         <header>HTTP/1.1 200 OK</header>
>         <header>X-Powered-By: Servlet/3.0</header>
>         <header>Content-Type: application/octet-stream</header>
>         <header>Content-Language: en-US</header>
>         <header>Set-Cookie: LtpaToken2=JAAuivq99D
> +v6sR6rfq7FlVsFPnHoMwp1hTG9Pd5FPPA7gVEzGcC4lyZaLdVrQtYIy09yVVvIScN110DpQaHOi5BLMBzGdJZZw/1a5qd
> +C7nKbfjWgUQCK6ZVbACSzHsgGdcn0trVobZ/Sl3WxiDL4kys
> +cvWzTB/AmZMgarNM70tEnoav51Y1t4JCBqDq5d1K1YnFs56E6W7gJSXnOQClEqRahUW7jgvKvvHppbECMo72rDA9ftVl/d3nwrKMVXF7GxXa0w5pFMCPf
> +r4kxYPFd3sWd0shmaK2Tepe0fX05W0O93dm8/ylkdHbP02eaiMmP
> +uLnOCCX4cHK4v7lzT0HFWdwBPvDcjgUR7HqXiakv/V0lbocsp2P/mGoL
> +bwJ4j8QJSmrTI/b7MbOPIJnF9zT5/TMgASyHLKdgItNIQZB3LRP6vN4Y0YuTuD5UOLoyqYfaZHlocZBVpWSTXE8N73h4880DWKwTpleGr0WMBZRQw/39EIQu29
> +MYc4qNt2ySAXp85P8G3rdzg
> +wNQJtZXD25cVYXWmtx4r5ouOu7bLbKPkON8p/jwcnk9uOtXE3bAPO1gv18LYBGBQjxBgJKN8hPR0b41/lhRjzZL86QqodHYrSURvSAgB
> +S3ynNfAfj/h5Rf6pjJyACpQKeNoWFaAJ0JmEzBK1qGlc+Ne9Q=; Path=/;
> HttpOnly</header>
>         <header>Set-Cookie:
> X-IBM-IISSessionId=oT9YXn09/H6fquWop8A6K9VFnXL/ZSfAHRBOb5V3MqZZArOL4rErcXklDC2ToSiWWRHfSkSDNm3oNOgHu20CoDLTipBXDTrAL6n05kwpQy0jbcvMQtglMgtAXLpD
> +LqbJ1zDQPYe8UKSC4HuNSdOHc9t3oMrGksIQRtDHkwmuHQ=; Path=/; HttpOnly</header>
>         <header>Transfer-Encoding: chunked</header>
>         <header>Connection: Close</header>
>         <header>Date: Sun, 02 Sep 2012 09:59:30 GMT</header>
>         <header>Server: WebSphere Application Server/8.0</header>
>         <header>Expires: Thu, 01 Dec 1994 16:00:00 GMT</header>
>         <header>Cache-Control: no-cache=&quot;set-cookie,
> set-cookie2&quot;</header>
>       </responseheaders>
>     </headers>
> 
> Thanks,
> Ravi Chamarthy
> IBM Information Platform & Solutions
> IBM Software Group
> ravi.chamarthy@in.ibm.com
> 
> 
> 
> From:	Oleg Kalnichevski <olegk@apache.org>
> To:	httpclient-users@hc.apache.org,
> Date:	08/28/2012 05:10 PM
> Subject:	Re: Randon "ProtocolException: The server failed to respond
>             with a valid HTTP response" while executing the client request
> 
> 
> 
> On Tue, 2012-08-28 at 12:00 +0530, Ravi C Chamarthy wrote:
> > Hi,
> >
> > I am running a junit test case, where the test methods would submit http
> > client requests to the target application server (WebSphere 8) which
> hosts
> > the serving application.
> > While running the test case, I randomly run into the following error,
> where
> > in first run, say testA() would fail, and in a successive test run testA
> ()
> > would pass but some other test method, say testB() would fail with the
> same
> > error message as listed below.
> > I am not sure what is happening as it not a constant error occurring for
> > the same method.
> > What's more confusing is, the Servlet listening to the HTTP requests is
> not
> > at all called when this error occurred. And also, I do not see any error
> > messages at the server side.
> >
> 
> This exception is thrown when the server simply drops the connection in
> the middle of HTTP exchange without responding in any meaningful way.
> Quite often that can happen when the server is unable to accept new
> incoming connections due to overload or an internal problem of some
> sort. The servlet never gets called because the connection gets dropped
> by WebSphere's HTTP stack before control is passed to your web
> application.
> 
> Oleg
> 
> PS: Please do _not_ cross post.
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 



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