Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 60374 invoked from network); 18 May 2009 16:14:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 May 2009 16:14:00 -0000 Received: (qmail 30866 invoked by uid 500); 18 May 2009 16:14:00 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 30827 invoked by uid 500); 18 May 2009 16:13:59 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 30817 invoked by uid 99); 18 May 2009 16:13:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 May 2009 16:13:59 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 May 2009 16:13:49 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1M65Sy-00023b-GR for httpclient-users@hc.apache.org; Mon, 18 May 2009 09:13:28 -0700 Message-ID: <23600284.post@talk.nabble.com> Date: Mon, 18 May 2009 09:13:28 -0700 (PDT) From: DerekC To: httpclient-users@hc.apache.org Subject: The target server failed to respond - What could be the problem ? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: cram.derek@gmail.com X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I'm using HttpComponents 4 and I'm getting the following error if I wait more than 15 seconds between 2 HTTP GET requests: org.apache.http.NoHttpResponseException: The target server failed to respond If I use HTTPClient 3.1 then the error is not the same: Connection is stale,closing... With HTTPClient 3.1, there is no exception, the connection seems closed and the application can go ahead. I think the problem is related to "Keep-Alive" management from server-side. What do you think about ? What parameters could I pass to HTTPComponents 4 to have the same behavior as HTTPClient 3.1 ? I've tried to use the following parameters without success: params = new BasicHttpParams(); ConnManagerParams.setMaxTotalConnections(params, 2); HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1); HttpProtocolParams.setUseExpectContinue(params, false); HttpConnectionParams.setStaleCheckingEnabled(params, true); SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443)); manager = new ThreadSafeClientConnManager(params, schemeRegistry); client = new DefaultHttpClient(manager, params); client.setReuseStrategy(new ConnectionReuseStrategy(){ public boolean keepAlive(HttpResponse arg0, HttpContext arg1) { return false; } }); Any advice would be welcome. Derek. -- View this message in context: http://www.nabble.com/The-target-server-failed-to-respond---What-could-be-the-problem---tp23600284p23600284.html Sent from the HttpClient-User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org