Return-Path: Mailing-List: contact commons-httpclient-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-httpclient-dev@jakarta.apache.org Received: (qmail 98882 invoked from network); 11 Feb 2003 20:51:00 -0000 Received: from mxout5.cac.washington.edu (140.142.32.135) by daedalus.apache.org with SMTP; 11 Feb 2003 20:51:00 -0000 Received: from smtp.washington.edu (smtp.washington.edu [140.142.33.9]) by mxout5.cac.washington.edu (8.12.1+UW01.12/8.12.1+UW02.12) with ESMTP id h1BKp4FR014656 for ; Tue, 11 Feb 2003 12:51:05 -0800 Received: from u.washington.edu (ss02.co.us.ibm.com [32.97.110.67]) (authenticated bits=0) by smtp.washington.edu (8.12.1+UW01.12/8.12.1+UW02.12) with ESMTP id h1BKp3Fk031244 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Tue, 11 Feb 2003 12:51:04 -0800 Message-ID: <3E496235.6010600@u.washington.edu> Date: Tue, 11 Feb 2003 15:51:01 -0500 From: Michael Becke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Commons HttpClient Project Subject: Re: Pooling HttpClient References: <01d601c2d20e$568d6f80$b91a448a@b7676gx240> In-Reply-To: <01d601c2d20e$568d6f80$b91a448a@b7676gx240> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I believe this is a bug that was recently fixed. I would recommend using the most recent code from CVS until the next release (alpha 3 or beta 1) comes out. Mike Sinead Whelan wrote: > Hi > > I wish to use HttpClient in a servlet based application. The HttpClient will be used to communicate with another internal server (always the same server). This communications will be in HTTP over SSL and I would like to be able to reuse connections to the server without having to do an expensive SSL handshake all the time. I would intend to have a long timeout on the HTTP connection (~15 minutes). > > Currently in my servlet I have code similar to below, > > class MyServlet extends HttpServlet { > > static HttpConnectionManager httpConnectionManager = new MultiThreadedHttpConnectionManager(); > static HttpClient httpClient = new HttpClient(httpConnectionManager); > > public void init() { > httpConnectionManager.setMaxConnectionsPerHost(150); > } > > > public void doPost(Req req, Response resp) { > PostMethod post = new PostMethod(url.getPath()); > post.setRequestContentLength(PostMethod.CONTENT_LENGTH_CHUNKED); > post.addParameter("TestReq", "Hello"); > > int result = httpClient.executeMethod(post); > > post.releaseConnection(); > } > > } > > This does not appear to work when a few users/threads are accessing the servlet at the same time. I get the following error message on the executeMethod(): > > Recoverable exception caught when reading response - couldn't find valid http header. (or something like that!) > > Do you think that this is the correct way to use it if you want to pool connection to same server (should I use static HttpClient)? > > Any help would be greatly appreciated. > > Cheers > > Sinead > > > ********************************************************************** > This document is strictly confidential and is intended for use by > the addressee unless otherwise indicated. > > Allied Irish Banks > ********************************************************************** > >