From httpclient-userslopezlauren@example.net Sun Feb 01 14:05:33 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 54530 invoked from network); 1 Feb 2009 14:05:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Feb 2009 14:05:33 -0000 Received: (qmail 79371 invoked by uid 500); 1 Feb 2009 14:05:32 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 79349 invoked by uid 500); 1 Feb 2009 14:05:32 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 79338 invoked by uid 99); 1 Feb 2009 14:05:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Feb 2009 06:05:31 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO ok2consulting.nine.ch) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Feb 2009 14:05:24 +0000 Received: by ok2consulting.nine.ch (Postfix, from userid 1002) id 1E8D7198568; Sun, 1 Feb 2009 15:05:01 +0100 (CET) Received: from [83.161.120.155] 646.665.3509.dclient.hispeed.ch [83.161.120.155]) by ok2consulting.nine.ch (Postfix) with ESMTP id EDBBC198566 for <lopezlauren@example.net>; Sun, 1 Feb 2009 15:04:58 +0100 (CET) Subject: Re: Unit testing HttpClient code From: Oleg Kalnichevski <lopezlauren@example.net> To: HttpClient User Discussion <lopezlauren@example.net> In-Reply-To: <lopezlauren@example.net> References: <lopezlauren@example.net> <lopezlauren@example.net> <lopezlauren@example.net> Content-Type: text/plain Date: Sun, 01 Feb 2009 15:04:53 +0100 Message-Id: <1233497093.5987.1.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on ok2consulting.nine.ch X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.3 On Sat, 2009-01-31 at 10:09 -0800, ying lcs wrote: > On 1/31/09, Oleg Kalnichevski <lopezlauren@example.net> wrote: > > ying lcs wrote: > > > I have the following code which uses HttpClient to do a post request. > > > Can you please tell tell me what is a good way to test it? Can I > > > create a mock http server object for the test to run against? > > > > > > HttpClient cli = getClient(); > > > HttpPost method; > > > > > > method = new HttpPost(url); > > > HttpResponse resp = null; > > > resp = cli.execute(method); > > > > > > Thank you. > > > > > > > > > > Yes, you can. > > > > There is a mock HTTP server implementation for HttpClient 3.x we use to test > > more complex HTTP scenarios: > > > > http://svn.apache.org/repos/asf/httpcomponents/oac.hc3x/trunk/src/test/org/apache/commons/httpclient/server/ > > > > However, I would _strongly_ recommend using the testing framework of > > HttpClient 4.0 instead of the old 3.x stuff: > > > > http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/localserver/ > > > > It is actually a complete, HTTP/1.1 compliant, embeddable HTTP server based > > on HttpCore, the same component stack used internally by HttpClient 4.0. > > > > Thank you. If I use the mock HTTP server from HttpClient4.0 does that > mean I have to upgrade my Http client to 4.0 version? No, it does not. > Can I just pull > the 'localserver' code from HttpClient4.0 and use that against my > current version of HttpClient? > Yes, you can. > Moreover, what is the dependencies of the 'localserver' code of HttpClient 4.0? > The test HTTP server should have no other dependencies besides HttpCore. Hope this helps Oleg > Thank you. > > > > Hope this helps. > > > > Oleg > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > lopezlauren@example.net > > > For additional commands, e-mail: > > lopezlauren@example.net > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > lopezlauren@example.net > > For additional commands, e-mail: > > lopezlauren@example.net > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lopezlauren@example.net > For additional commands, e-mail: lopezlauren@example.net > --------------------------------------------------------------------- To unsubscribe, e-mail: lopezlauren@example.net For additional commands, e-mail: lopezlauren@example.net From httpclient-userslopezlauren@example.net Sun Feb 01 20:02:44 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 95721 invoked from network); 1 Feb 2009 20:02:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Feb 2009 20:02:44 -0000 Received: (qmail 3687 invoked by uid 500); 1 Feb 2009 20:02:43 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 3615 invoked by uid 500); 1 Feb 2009 20:02:43 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 3593 invoked by uid 99); 1 Feb 2009 20:02:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Feb 2009 12:02:42 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO ok2consulting.nine.ch) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Feb 2009 20:02:35 +0000 Received: by ok2consulting.nine.ch (Postfix, from userid 1002) id 09259198568; Sun, 1 Feb 2009 21:02:12 +0100 (CET) Received: from [83.161.120.155] 646.665.3509.dclient.hispeed.ch [83.161.120.155]) by ok2consulting.nine.ch (Postfix) with ESMTP id 12EFC198523; Sun, 1 Feb 2009 21:02:09 +0100 (CET) Message-ID: <lopezlauren@example.net> Date: Sun, 01 Feb 2009 21:01:58 +0100 From: Oleg Kalnichevski <lopezlauren@example.net> User-Agent: Thunderbird 83.161.120.155 (Windows/20081209) MIME-Version: 1.0 To: lopezlauren@example.net, lopezlauren@example.net Subject: [HttpCore] HttpCore 4.0 final release is imminent Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on ok2consulting.nine.ch X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.3 Folks I have finally completed documentation for HttpCore. You can find the preview of API docs here: http://people.apache.org/~olegk/httpcore-4.0-final/doc/site/apidocs/ The HttpCore tutorial can be found here: [html] http://people.apache.org/~olegk/httpcore-4.0-final/doc/docbkx/html/ [pdf] http://people.apache.org/~olegk/httpcore-4.0-final/doc/docbkx/pdf/index.pdf There have been virtually no major bugs found in HttpCore since the last release. We have had only two bug fixes in the past 4 months. I personally think there no longer any reason delaying the final release, especially given the fact there is now a complete API documentation. Please review the documents and let me know what you think. Please feel free to point out areas that need more coverage. Any feedback, comment, or critique will be hugely appreciated. If I hear no major complaints about the quality of documentation I will start cutting the official release packages approximately in a week time. The same work needs to be done for HttpClient 4.0 at some point of time. The sooner the documentation for HttpClient is completed the sooner we can release the final 4.0 version. So, a helping hand would be very, very, very appreciated. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: lopezlauren@example.net For additional commands, e-mail: lopezlauren@example.net From httpclient-userslopezlauren@example.net Mon Feb 02 13:35:43 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 56510 invoked from network); 2 Feb 2009 13:35:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Feb 2009 13:35:43 -0000 Received: (qmail 55416 invoked by uid 500); 2 Feb 2009 13:35:42 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 55382 invoked by uid 500); 2 Feb 2009 13:35:42 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 55371 invoked by uid 99); 2 Feb 2009 13:35:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 05:35:42 -0800 X-ASF-Spam-Status: No, hits=4.0 required=10.0 tests=HTML_MESSAGE,MISSING_MID,SPF_PASS,SUBJ_ALL_CAPS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail.interd4u.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 13:35:33 +0000 Received: (qmail 15993 invoked by uid 512); 2 Feb 2009 13:35:11 -0000 Received: from 83.161.120.155 by jupiter (envelope-from <lopezlauren@example.net>, uid 508) with qmail-scanner-1.25st (clamdscan: 0.87/1149. spamassassin: 3.1.0. Clear:RC:1(83.161.120.155):. Processed in 0.667493 secs); 02 Feb 2009 13:35:11 -0000 Received: from 93.red-80-25-178.staticip.rima-tde.net (HELO Portatil04) (lopezlauren@example.net@83.161.120.155) by jupiter with ESMTPA; 2 Feb 2009 13:35:10 -0000 From: =?iso-8859-1?Q?Joan_Balaguer=F3?= <lopezlauren@example.net> To: "'HttpClient User Discussion'" <lopezlauren@example.net> Subject: HTTP RETRY HANDLER Date: Mon, 2 Feb 2009 14:35:03 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0002_01C98543.702DC2C0" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 Thread-Index: AcmFOw19DmM4fEV8QsGb13rX3HnERg== X-Qmail-Scanner-Message-ID: <123358171192215984@jupiter> X-Virus-Checked: Checked by ClamAV on apache.org Message-Id: <lopezlauren@example.net> ------=_NextPart_000_0002_01C98543.702DC2C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, =20 To set a retryHandler: this.objHttp.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(retryHttp, false)); =20 But if I want to disable this retry handler (because the user doesn=92t = want to retry anything), how can I do this? =20 Thanks, Joan.=20 =20 =20 =20 ------=_NextPart_000_0002_01C98543.702DC2C0-- From httpclient-userslopezlauren@example.net Mon Feb 02 17:30:42 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 82791 invoked from network); 2 Feb 2009 17:30:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Feb 2009 17:30:41 -0000 Received: (qmail 36403 invoked by uid 500); 2 Feb 2009 17:30:40 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 36382 invoked by uid 500); 2 Feb 2009 17:30:40 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 36371 invoked by uid 99); 2 Feb 2009 17:30:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 09:30:40 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lopezlauren@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO kuber.nabble.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 17:30:31 +0000 Received: from isper.nabble.com ([83.161.120.155]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from <lopezlauren@example.net>) id 1LU2cc-0003Jw-FH for lopezlauren@example.net; Mon, 02 Feb 2009 09:30:10 -0800 Message-ID: <lopezlauren@example.net> Date: Mon, 2 Feb 2009 09:30:10 -0800 (PST) From: stoli <lopezlauren@example.net> To: lopezlauren@example.net Subject: Re: Can't keep session alive In-Reply-To: <lopezlauren@example.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: lopezlauren@example.net References: <lopezlauren@example.net> <1232801293.7134.2.camel@ubuntu> <lopezlauren@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Once again, thanks for the help. Ultimately, the solution involved several things. I think the single-cookie-header parameter was one piece of the puzzle. The rest of the problems were with the login process at the site. I found an invaluable tool called Live HTTP Headers - a free FireFox addon. This exposed a multitude of redirects on the intial login. Using that information I was able to piece together the necessary GET requests and associated headers which ultimately allowed me to successfully log in and sustain a session by mimicking a FireFox browser. Rick -- View this message in context: http://www.nabble.com/Can%27t-keep-session-alive-tp21628339p21794139.html Sent from the HttpClient-User mailing list lopezlauren@example.net. --------------------------------------------------------------------- To unsubscribe, e-mail: lopezlauren@example.net For additional commands, e-mail: lopezlauren@example.net From httpclient-userslopezlauren@example.net Mon Feb 02 22:41:26 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 10459 invoked from network); 2 Feb 2009 22:41:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Feb 2009 22:41:26 -0000 Received: (qmail 66961 invoked by uid 500); 2 Feb 2009 22:41:25 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 66933 invoked by uid 500); 2 Feb 2009 22:41:25 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 66922 invoked by uid 99); 2 Feb 2009 22:41:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 14:41:25 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lopezlauren@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO bay0-omc1-s28.bay0.hotmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 22:41:13 +0000 Received: from BAY124-W5 ([83.161.120.155]) by bay0-omc1-s28.bay0.hotmail.com with Microsoft SMTPSVC646.665.3509); Mon, 2 Feb 2009 14:40:53 -0800 Message-ID: <lopezlauren@example.net> Content-Type: multipart/alternative; boundary="_ff745286-a205-4e8d-abda-1cd9c16e6173_" X-Originating-IP: [83.161.120.155] From: Anjum Naseer <lopezlauren@example.net> To: <lopezlauren@example.net> Subject: Using HTTP Basic Authentication with htmlunit/httpclient and more than one browser instance fails Date: Mon, 2 Feb 2009 22:40:52 +0000 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 02 Feb 2009 22:40:53.0023 (UTC) FILETIME=[4DDDCAF0:01C98587] X-Virus-Checked: Checked by ClamAV on apache.org --_ff745286-a205-4e8d-abda-1cd9c16e6173_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am using htmlunit v2.4 (which in turn uses httpclient v3.1) and am=20 having problems with testing HTTP Basic Authentication against my=20 REST-based web service using two types of browsers. I am creating my two browsers and credentials as follows: final WebClient xhtmlBrowser =3D new WebClient(BrowserVersion.FIREFOX_2)= =3B xhtmlBrowser.addRequestHeader("ACCEPT"=2C=20 "text/html=2Capplication/xhtml+xml")=3B xhtmlBrowser.setRedirectEnabled(true)=3B xhtmlBrowser.setUseInsecureSSL(true)=3B final WebClient jsonBrowser =3D new WebClient()=3B jsonBrowser.addRequestHeader("ACCEPT"=2C "application/json")=3B jsonBrowser.setRedirectEnabled(true)=3B jsonBrowser.setUseInsecureSSL(true)=3B final DefaultCredentialsProvider userCredentials =3D new=20 DefaultCredentialsProvider()=3B userCredentials.addCredentials("someName"=2C "somePassword")=3B I then browse to my web service using code like this: xhtmlBrowser.setCredentialsProvider(userCredentials)=3B final WebResponse xhtmlResponse =3D=20 xhtmlBrowser.getPage("http://...").getWebResponse()=3B ... jsonBrowser.setCredentialsProvider(userCredentials)=3B final WebResponse jsonResponse =3D=20 jsonBrowser.getPage("http://...").getWebResponse()=3B ... My web service redirects to an HTTPS URI and requires HTTP Basic=20 Authentication (I am using Suns Jersey product=20 (https://jersey.dev.java.net/) to write my REST-based Web Service). The first response (xhtmlResponse) comes back all fine and I can process=20 and check that the response is as I expected. However=2C the second response (jsonResponse) fails with: ... ... org.apache.commons.httpclient.auth.AuthChallengeProcessor=20 selectAuthScheme INFO: basic authentication scheme selected ... org.apache.commons.httpclient.HttpMethodDirector=20 processWWWAuthChallenge INFO: No credentials available for BASIC 'SmartInspector'@localhost:8181 ... com.gargoylesoftware.htmlunit.WebClient printContentIfNecessary INFO: statusCode=3D[401] contentType=3D[text/html] ... com.gargoylesoftware.htmlunit.WebClient printContentIfNecessary ... HTTP Status 401 - An Authentication object was not found in the=20 SecurityContext ... This request requires HTTP authentication (An Authentication=20 object was not found in the SecurityContext). ... Sun Java System Application Server 9.1_02 If I comment out the first request like so: // xhtmlBrowser.setCredentialsProvider(userCredentials)=3B // final WebResponse xhtmlResponse =3D xhtmlBrowser.getPage("http://...").getWebResponse()=3B // ... jsonBrowser.setCredentialsProvider(userCredentials)=3B final WebResponse jsonResponse =3D jsonBrowser.getPage("http://...").getWebResponse()=3B ... Then the second (jsonResponse) request works just fine. I actually have=20 a list of four different types of browsers that I iterate through to=20 test that my service works against all of them=2C but I have simplified the example to=20 illustrate the problem. I get the same problem even if I directly browse to "https://..."=20 thereby avoiding the redirect from http to https by my service. Is there some cleanup step between the two getWebResponse() calls that I=20 am missing or is this a bug in httpclient? Thanks in advance=2C Anjum. _________________________________________________________________ Check out the new and improved services from Windows Live. Learn more!=20 http://clk.atdmt.com/UKM/go/132630768/direct/01/= --_ff745286-a205-4e8d-abda-1cd9c16e6173_-- From httpclient-userslopezlauren@example.net Mon Feb 02 23:11:07 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 25405 invoked from network); 2 Feb 2009 23:11:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Feb 2009 23:11:07 -0000 Received: (qmail 13629 invoked by uid 500); 2 Feb 2009 23:11:05 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 13612 invoked by uid 500); 2 Feb 2009 23:11:05 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 13601 invoked by uid 99); 2 Feb 2009 23:11:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 15:11:05 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lopezlauren@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO bay0-omc1-s29.bay0.hotmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Feb 2009 23:10:54 +0000 Received: from BAY124-W16 ([83.161.120.155]) by bay0-omc1-s29.bay0.hotmail.com with Microsoft SMTPSVC646.665.3509); Mon, 2 Feb 2009 15:10:33 -0800 Message-ID: <lopezlauren@example.net> Content-Type: multipart/alternative; boundary="_a3e4d478-e1c3-421a-a6af-5124d02c9a82_" X-Originating-IP: [83.161.120.155] From: Anjum Naseer <lopezlauren@example.net> To: <lopezlauren@example.net> Subject: RE: Using HTTP Basic Authentication with htmlunit/httpclient and more than one browser instance fails Date: Mon, 2 Feb 2009 23:10:32 +0000 Importance: Normal In-Reply-To: <lopezlauren@example.net> References: <lopezlauren@example.net> MIME-Version: 1.0 X-OriginalArrivalTime: 02 Feb 2009 23:10:33.0004 (UTC) FILETIME=[72D156C0:01C9858B] X-Virus-Checked: Checked by ClamAV on apache.org --_a3e4d478-e1c3-421a-a6af-5124d02c9a82_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Sorry - I looked into the error in more detail and found that I cannot re-u= se the credentials instance since it gets marked as "answered" by the under= lying httpclient library on the first request. If I create a new instance o= f DefaultCredentialsProvider before each request=2C then it all works as I = expected. > From: lopezlauren@example.net > To: lopezlauren@example.net > Subject: Using HTTP Basic Authentication with htmlunit/httpclient and mor= e than one browser instance fails > Date: Mon=2C 2 Feb 2009 22:40:52 +0000 >=20 >=20 > I am using htmlunit v2.4 (which in turn uses httpclient v3.1) and am=20 > having problems with testing HTTP Basic Authentication against my=20 > REST-based web service using two types of browsers. >=20 > I am creating my two browsers and credentials as follows: > final WebClient xhtmlBrowser =3D new WebClient(BrowserVersion.FIREFOX_= 2)=3B > xhtmlBrowser.addRequestHeader("ACCEPT"=2C=20 > "text/html=2Capplication/xhtml+xml")=3B > xhtmlBrowser.setRedirectEnabled(true)=3B > xhtmlBrowser.setUseInsecureSSL(true)=3B >=20 > final WebClient jsonBrowser =3D new WebClient()=3B > jsonBrowser.addRequestHeader("ACCEPT"=2C "application/json")=3B > jsonBrowser.setRedirectEnabled(true)=3B > jsonBrowser.setUseInsecureSSL(true)=3B >=20 > final DefaultCredentialsProvider userCredentials =3D new=20 > DefaultCredentialsProvider()=3B > userCredentials.addCredentials("someName"=2C "somePassword")=3B >=20 > I then browse to my web service using code like this: > xhtmlBrowser.setCredentialsProvider(userCredentials)=3B > final WebResponse xhtmlResponse =3D=20 > xhtmlBrowser.getPage("http://...").getWebResponse()=3B > ... > jsonBrowser.setCredentialsProvider(userCredentials)=3B > final WebResponse jsonResponse =3D=20 > jsonBrowser.getPage("http://...").getWebResponse()=3B > ... >=20 > My web service redirects to an HTTPS URI and requires HTTP Basic=20 > Authentication (I am using Suns Jersey product=20 > (https://jersey.dev.java.net/) to write my REST-based Web Service). >=20 > The first response (xhtmlResponse) comes back all fine and I can process= =20 > and check that the response is as I expected. > However=2C the second response (jsonResponse) fails with: > ... > ... org.apache.commons.httpclient.auth.AuthChallengeProcessor=20 > selectAuthScheme > INFO: basic authentication scheme selected > ... org.apache.commons.httpclient.HttpMethodDirector=20 > processWWWAuthChallenge > INFO: No credentials available for BASIC 'SmartInspector'@localhost:81= 81 > ... com.gargoylesoftware.htmlunit.WebClient printContentIfNecessary > INFO: statusCode=3D[401] contentType=3D[text/html] > ... com.gargoylesoftware.htmlunit.WebClient printContentIfNecessary > ... HTTP Status 401 - An Authentication object was not found in the=20 > SecurityContext > ... This request requires HTTP authentication (An Authentication=20 > object was not found in the SecurityContext). > ... Sun Java System Application Server 9.1_02 >=20 > If I comment out the first request like so: > // xhtmlBrowser.setCredentialsProvider(userCredentials)=3B > // final WebResponse xhtmlResponse =3D > xhtmlBrowser.getPage("http://...").getWebResponse()=3B > // ... > jsonBrowser.setCredentialsProvider(userCredentials)=3B > final WebResponse jsonResponse =3D > jsonBrowser.getPage("http://...").getWebResponse()=3B > ... >=20 > Then the second (jsonResponse) request works just fine. I actually have=20 > a list of four different types of browsers that I iterate through to=20 > test that my > service works against all of them=2C but I have simplified the example to= =20 > illustrate the problem. >=20 > I get the same problem even if I directly browse to "https://..."=20 > thereby avoiding the redirect from http to https by my service. >=20 > Is there some cleanup step between the two getWebResponse() calls that I= =20 > am missing or is this a bug in httpclient? >=20 > Thanks in advance=2C >=20 > Anjum. >=20 >=20 > _________________________________________________________________ > Check out the new and improved services from Windows Live. Learn more!=20 > http://clk.atdmt.com/UKM/go/132630768/direct/01/ _________________________________________________________________ Twice the fun=97Share photos while you chat with Windows Live Messenger. Le= arn more. http://www.microsoft.com/uk/windows/windowslive/products/messenger.aspx= --_a3e4d478-e1c3-421a-a6af-5124d02c9a82_-- From httpclient-userslopezlauren@example.net Tue Feb 03 15:17:11 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 65608 invoked from network); 3 Feb 2009 15:17:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Feb 2009 15:17:11 -0000 Received: (qmail 60331 invoked by uid 500); 3 Feb 2009 15:17:09 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 60310 invoked by uid 500); 3 Feb 2009 15:17:09 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 60299 invoked by uid 99); 3 Feb 2009 15:17:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 07:17:09 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO ok2consulting.nine.ch) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 15:17:01 +0000 Received: by ok2consulting.nine.ch (Postfix, from userid 1002) id 80626198568; Tue, 3 Feb 2009 16:16:37 +0100 (CET) Received: from [83.161.120.155] (unknown [83.161.120.155]) by ok2consulting.nine.ch (Postfix) with ESMTP id 1266B198523 for <lopezlauren@example.net>; Tue, 3 Feb 2009 16:16:32 +0100 (CET) Subject: Re: HTTP RETRY HANDLER From: Oleg Kalnichevski <lopezlauren@example.net> To: HttpClient User Discussion <lopezlauren@example.net> In-Reply-To: <lopezlauren@example.net> References: <lopezlauren@example.net> Content-Type: text/plain; charset="UTF-8" Date: Tue, 03 Feb 2009 16:12:10 +0100 Message-Id: <1233673930.5642.39.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on ok2consulting.nine.ch X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.3 On Mon, 2009-02-02 at 14:35 +0100, Joan Balagueró wrote: > Hello, > > > > To set a retryHandler: > > this.objHttp.setHttpRequestRetryHandler(new > DefaultHttpRequestRetryHandler(retryHttp, false)); > > > > But if I want to disable this retry handler (because the user doesn't want > to retry anything), how can I do this? > --- DefaultHttpClient httpclient = new DefaultHttpClient(); httpclient.setHttpRequestRetryHandler(new HttpRequestRetryHandler() { public boolean retryRequest( IOException exception, int executionCount, HttpContext context) { return false; } }); --- Oleg > > > Thanks, > > Joan. > > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: lopezlauren@example.net For additional commands, e-mail: lopezlauren@example.net From httpclient-userslopezlauren@example.net Tue Feb 03 15:17:31 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 65746 invoked from network); 3 Feb 2009 15:17:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Feb 2009 15:17:31 -0000 Received: (qmail 60748 invoked by uid 500); 3 Feb 2009 15:17:30 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 60720 invoked by uid 500); 3 Feb 2009 15:17:30 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 60709 invoked by uid 99); 3 Feb 2009 15:17:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 07:17:30 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO ok2consulting.nine.ch) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 15:17:21 +0000 Received: by ok2consulting.nine.ch (Postfix, from userid 1002) id 7A37A198569; Tue, 3 Feb 2009 16:16:59 +0100 (CET) Received: from [83.161.120.155] (unknown [83.161.120.155]) by ok2consulting.nine.ch (Postfix) with ESMTP id BD786198523 for <lopezlauren@example.net>; Tue, 3 Feb 2009 16:16:54 +0100 (CET) Subject: Re: Can't keep session alive From: Oleg Kalnichevski <lopezlauren@example.net> To: HttpClient User Discussion <lopezlauren@example.net> In-Reply-To: <lopezlauren@example.net> References: <lopezlauren@example.net> <1232801293.7134.2.camel@ubuntu> <lopezlauren@example.net> <lopezlauren@example.net> Content-Type: text/plain Date: Tue, 03 Feb 2009 16:15:07 +0100 Message-Id: <1233674107.5642.42.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on ok2consulting.nine.ch X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.3 On Mon, 2009-02-02 at 09:30 -0800, stoli wrote: > Once again, thanks for the help. Ultimately, the solution involved several > things. I think the single-cookie-header parameter was one piece of the > puzzle. The rest of the problems were with the login process at the site. I > found an invaluable tool called Live HTTP Headers - a free FireFox addon. > This exposed a multitude of redirects on the intial login. Using that > information I was able to piece together the necessary GET requests and > associated headers which ultimately allowed me to successfully log in and > sustain a session by mimicking a FireFox browser. > > Rick This is hardly surprising, as lots of web sites (especially high profile ones) do intensionally make it difficult to script the login process. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: lopezlauren@example.net For additional commands, e-mail: lopezlauren@example.net From httpclient-userslopezlauren@example.net Wed Feb 04 13:59:39 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 31651 invoked from network); 4 Feb 2009 13:59:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Feb 2009 13:59:38 -0000 Received: (qmail 2744 invoked by uid 500); 4 Feb 2009 13:59:37 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 2709 invoked by uid 500); 4 Feb 2009 13:59:37 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 2696 invoked by uid 99); 4 Feb 2009 13:59:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 05:59:37 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lopezlauren@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO ti-out-0910.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 13:59:28 +0000 Received: by ti-out-0910.google.com with SMTP id i7so8828tid.2 for <lopezlauren@example.net>; Wed, 04 Feb 2009 05:58:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=rVQipGQV7o/gwLaRth5aTsiXw3sIVtkW5EMNUtBrv6A=; b=VBjjaaeGTPqJr61cyF7+D9rDagwsciAgnqjpWi4Qbu4K3LVH4uU3s5VasJhNByWX// RzwgXhHRqG8+HY/o2105YZpI8mrvHhts00kjGZCXT9hRZpotwKsYLmeoGOe7QNceiWYC ONnIlfATIsoIHIxuYsXZE8QndRdKHkNtYWido= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=m53uIvsh/9JMMGn/JO1e27xi8vpOdvgHpH2vqOHDn+/B0jM70a92CGKI+M4EpF8srX GCs7tayh27Kgw10ZlO5E1yly047Qcr8rT8STVSv3RuhtmhReKTp87A0FEOAwMG+HGrX/ 4y/uIkOoiS7rQRQURQYBws9Lsac0n1wV000RM= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id v3mr160630tia.7.1233755483673; Wed, 04 Feb 2009 05:51:23 -0800 (PST) Date: Wed, 4 Feb 2009 18:51:23 +0500 Message-ID: <lopezlauren@example.net> Subject: unable to do basic authentication From: alee amin <lopezlauren@example.net> To: lopezlauren@example.net Content-Type: multipart/alternative; boundary=0016e652d22a58158f0462181568 X-Virus-Checked: Checked by ClamAV on apache.org --0016e652d22a58158f0462181568 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit hi, I am trying to send a request to my own website which is using basic authentication method. But i am unable to to authenticate it through httpclient here is the code i am using HttpClient httpClient = new HttpClient(); HttpMethod httpGet = new GetMethod(" http://localhost:8080/project-web/Servlet"); httpClient.getState().setCredentials( new AuthScope("http://localhost:8080", 443, "realm"), new UsernamePasswordCredentials("userName", "Password")); httpGet.setDoAuthentication(true); try{ int status = httpClient.executeMethod(httpGet); byte[] response = httpGet.getResponseBody(); System.out.println("status: " + status); System.out.println("response: " + new String(response)); } catch (Exception ex){ } There is no exception that is being raised. I am getting the status code 401 with "responseBody" having text ... "this request require authentication". Am i missing something? ..alee http://techboard.wordpress.com --0016e652d22a58158f0462181568-- From httpclient-userslopezlauren@example.net Wed Feb 04 14:09:23 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 40375 invoked from network); 4 Feb 2009 14:09:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Feb 2009 14:09:23 -0000 Received: (qmail 16469 invoked by uid 500); 4 Feb 2009 14:09:19 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 16451 invoked by uid 500); 4 Feb 2009 14:09:19 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 16436 invoked by uid 99); 4 Feb 2009 14:09:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 06:09:19 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lopezlauren@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO ti-out-0910.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 14:09:11 +0000 Received: by ti-out-0910.google.com with SMTP id i7so12040tid.2 for <lopezlauren@example.net>; Wed, 04 Feb 2009 06:08:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=xmjvoT9s3+/U9ET0W08aDLYXDotvp4dK2PpMhxQezI4=; b=tqFEkx4zUYRY8I0ky//+PGd5zVxQm/orbRGFiVbmKgH1wnJPcH1K+X/gQ1Urz04CFE NHzGvpsQKyItpjJwfjRp5CbKmXTT8cyI5KKxPOchc3t9sdgC7N2snOj3p/DQxnESE5kF 54XwjrryJBr4pcoe120UDcCeNaZXL02dlRAec= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=hFr5fs5aqg0Dsl1j4f99nw5dUAF4eVp6G0I9CuzUocCkhWw0tlfiARTePBTgMZ/ehW LG/Ui1Nz65swf8/xOyQygrAGhf2kYo4Ne9ww5/p/K+cLNbm26Uo65je3aZFt2c00TyCx xrJQz1lVL+oIyCpB+lGCP5h4wv09bZjVceSxo= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id x19mr9695879tix.12.1233756529410; Wed, 04 Feb 2009 06:08:49 -0800 (PST) In-Reply-To: <lopezlauren@example.net> References: <lopezlauren@example.net> Date: Wed, 4 Feb 2009 19:08:49 +0500 Message-ID: <lopezlauren@example.net> Subject: Re: unable to do basic authentication From: alee amin <lopezlauren@example.net> To: lopezlauren@example.net Content-Type: multipart/alternative; boundary=001485f01ad4acc11c0462185377 X-Virus-Checked: Checked by ClamAV on apache.org --001485f01ad4acc11c0462185377 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit ok - i got it. i was authenticating it on 443 - now i have changed to the appropriate port. it worked. thanks :) ..alee http://techboard.wordpress.com On Wed, Feb 4, 2009 at 6:51 PM, alee amin <lopezlauren@example.net>wrote: > hi, > I am trying to send a request to my own website which is using basic > authentication method. But i am unable to to authenticate it through > httpclient > > here is the code i am using > > HttpClient httpClient = new HttpClient(); > HttpMethod httpGet = new GetMethod(" > http://localhost:8080/project-web/Servlet"); > > httpClient.getState().setCredentials( > new AuthScope("http://localhost:8080", 443, "realm"), > new UsernamePasswordCredentials("userName", "Password")); > > httpGet.setDoAuthentication(true); > > try{ > int status = httpClient.executeMethod(httpGet); > byte[] response = httpGet.getResponseBody(); > System.out.println("status: " + status); > System.out.println("response: " + new String(response)); > } > catch (Exception ex){ > } > > There is no exception that is being raised. I am getting the status code > 401 with "responseBody" having text ... "this request require > authentication". Am i missing something? > ..alee > http://techboard.wordpress.com > > --001485f01ad4acc11c0462185377-- From httpclient-userslopezlauren@example.net Wed Feb 04 15:04:28 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 93137 invoked from network); 4 Feb 2009 15:04:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Feb 2009 15:04:28 -0000 Received: (qmail 16919 invoked by uid 500); 4 Feb 2009 15:04:26 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 16891 invoked by uid 500); 4 Feb 2009 15:04:26 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 16880 invoked by uid 99); 4 Feb 2009 15:04:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 07:04:26 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lopezlauren@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO ti-out-0910.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 15:04:17 +0000 Received: by ti-out-0910.google.com with SMTP id i7so27217tid.2 for <lopezlauren@example.net>; Wed, 04 Feb 2009 07:03:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=C3yx/jQtYNtxI5vJp6GKv2FQ1FMOEUoQvy6MJh4+IXk=; b=Tsq6/ise6dXw2dgqVQYh+42mNvBhDd8A1ExjK/+5V9dKirdln0O1E9trldOtRMzWEb PvqznRnhGpvWJJ0bTC3YG8V1UGubpj71caE2cd2sov9bAknRjqKXF6eRnxXp/7Ok0AZW MzuG2WMw/H79X2hFSajRYVBo1p3kMcO8gJ100= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=sk4GYIJXRsjlxI/OcYfixGD+9PhC9ENeYIoITFbrTSXWdECKOcE2v1/LB8ZajywWTc A/mUpECWhH9R/gMFc9gza4VoSOaf1t8a77phGAsQ8D8p3j4zcEZUAga3LNJG1f5BWFsa NEHIhgq4uaYTWmJHr3oX2lFqEQKz7pV94yf4I= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id 15mr7360112tit.46.1233759835558; Wed, 04 Feb 2009 07:03:55 -0800 (PST) Date: Wed, 4 Feb 2009 20:03:55 +0500 Message-ID: <lopezlauren@example.net> Subject: disabling logs From: alee amin <lopezlauren@example.net> To: lopezlauren@example.net Content-Type: multipart/alternative; boundary=0016e652d1f2bc94e504621918bf X-Virus-Checked: Checked by ClamAV on apache.org --0016e652d1f2bc94e504621918bf Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I need to disable the logging of httpClient - all logging. I have read the settings from "logging" page but i am not able to disable logs. can someone guide me. ..alee http://techboard.wordpress.com --0016e652d1f2bc94e504621918bf-- From httpclient-userslopezlauren@example.net Wed Feb 04 21:30:21 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 60709 invoked from network); 4 Feb 2009 21:30:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Feb 2009 21:30:20 -0000 Received: (qmail 60942 invoked by uid 500); 4 Feb 2009 21:30:20 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 60558 invoked by uid 500); 4 Feb 2009 21:30:19 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 60547 invoked by uid 99); 4 Feb 2009 21:30:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 13:30:19 -0800 X-ASF-Spam-Status: No, hits=-1.8 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lopezlauren@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO e6.ny.us.ibm.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 21:30:10 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [83.161.120.155]) by e6.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n14LUMWg014205 for <lopezlauren@example.net>; Wed, 4 Feb 2009 16:30:22 -0500 Received: from d01av05.pok.ibm.com (d01av05.pok.ibm.com [83.161.120.155]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id n14LTlQX165788 for <lopezlauren@example.net>; Wed, 4 Feb 2009 16:29:49 -0500 Received: from d01av05.pok.ibm.com (loopback [83.161.120.155]) by d01av05.pok.ibm.com (8.13.1/8.13.3) with ESMTP id n14LTlOh031962 for <lopezlauren@example.net>; Wed, 4 Feb 2009 16:29:47 -0500 Received: from d01ml255.pok.ibm.com (d01ml255.pok.ibm.com [83.161.120.155]) by d01av05.pok.ibm.com (8.13.1/8.12.11) with ESMTP id n14LTl6B031959 for <lopezlauren@example.net>; Wed, 4 Feb 2009 16:29:47 -0500 To: HttpClient User Discussion <lopezlauren@example.net> MIME-Version: 1.0 Subject: Mapping javax.servlet to HttpCore - best practices questions X-KeepSent: 5BCA80BE:C2EA6D47-85257553:007395A3; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.0.2 HF88 September 24, 2008 From: Todd W Lainhart <lopezlauren@example.net> Message-ID: <lopezlauren@example.net> Date: Wed, 4 Feb 2009 16:29:45 -0500 X-MIMETrack: Serialize by Router on D01ML255/01/M/IBM(Release 8.0.1|February 07, 2008) at 02/04/2009 16:29:46, Serialize complete at 02/04/2009 16:29:46 Content-Type: multipart/alternative; boundary="=_alternative 0076146085257553_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 0076146085257553_= Content-Type: text/plain; charset="US-ASCII" I'm working on a prototype where I hide the HttpServletRequest/Response objects and the various servlet goo-age behind HttpRequest/Response. Imagine that a servlet is calling out to a handler of a "service(...)" where the parameters are HttpRequest/Response, populated by the servlet prior to calling this handler. I'm looking for best practices to do this, based on the design of the HttpCore classes and the expectations of clients that receive HttpRequest/Response objects. I've done "TheGuidedTour..." and read some Javadoc. HttpServletRequest headers: These seem straightforward enough - I just copy these into the headers of the HttpServletRequest. HttpServletRequest parameters: Based on my reading of "GuidedTour..." I'm guessing that stuff this parameter map into some HttpParams derivation associated to the HttpRequest, and document the well-known key? HttpServletRequest other data : Likewise, I stuff this data into HttpParams (either Basic or a specialized derivation)? ServletRequest host info : I grab this data, put it into an HttpHost object, and associate it to the HttpRequest's HttpContext? In dealing with the HttpResponse when shipping this data back out through the HttpServletResponse, I think I'm going to want to run the responses interceptors as well as checking headers. If both a header and an interceptor for that header is defined, it looks like I should err-out, rather than prefer one over the other? -- Todd --=_alternative 0076146085257553_=-- From httpclient-userslopezlauren@example.net Wed Feb 04 23:22:11 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 44571 invoked from network); 4 Feb 2009 23:22:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Feb 2009 23:22:11 -0000 Received: (qmail 58080 invoked by uid 500); 4 Feb 2009 23:22:10 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 58052 invoked by uid 500); 4 Feb 2009 23:22:10 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 58041 invoked by uid 99); 4 Feb 2009 23:22:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 15:22:10 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO ok2consulting.nine.ch) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 23:22:02 +0000 Received: by ok2consulting.nine.ch (Postfix, from userid 1002) id 38108198567; Thu, 5 Feb 2009 00:21:40 +0100 (CET) Received: from [83.161.120.155] 646.665.3509.dclient.hispeed.ch [83.161.120.155]) by ok2consulting.nine.ch (Postfix) with ESMTP id 002AD198523 for <lopezlauren@example.net>; Thu, 5 Feb 2009 00:21:37 +0100 (CET) Message-ID: <lopezlauren@example.net> Date: Thu, 05 Feb 2009 00:21:32 +0100 From: Oleg Kalnichevski <lopezlauren@example.net> User-Agent: Thunderbird 83.161.120.155 (Windows/20081209) MIME-Version: 1.0 To: HttpClient User Discussion <lopezlauren@example.net> Subject: Re: Mapping javax.servlet to HttpCore - best practices questions References: <lopezlauren@example.net> In-Reply-To: <lopezlauren@example.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on ok2consulting.nine.ch X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.3 Todd W Lainhart wrote: > I'm working on a prototype where I hide the HttpServletRequest/Response > objects and the various servlet goo-age behind HttpRequest/Response. > Imagine that a servlet is calling out to a handler of a "service(...)" > where the parameters are HttpRequest/Response, populated by the servlet > prior to calling this handler. I'm looking for best practices to do this, > based on the design of the HttpCore classes and the expectations of > clients that receive HttpRequest/Response objects. I've done > "TheGuidedTour..." and read some Javadoc. > Todd, The guided tour is somewhat outdated. There is a more recent and more complete document describing HttpCore API and its intended usage: http://hc.apache.org/httpcomponents-core/tutorial/html/ http://hc.apache.org/httpcomponents-core/tutorial/pdf/httpcore-tutorial.pdf I'll look into your questions tomorrow in details and try to give you some recommendations. However, I just cannot help wondering what it the reason for trying to put HttpCore on top of a Servlet based transport? While HTTP headers may be relatively easy to map, content streaming may be significantly more difficult to achieve without a certain performance degradation. Oleg > HttpServletRequest headers: These seem straightforward enough - I just > copy these into the headers of the HttpServletRequest. > > HttpServletRequest parameters: Based on my reading of "GuidedTour..." I'm > guessing that stuff this parameter map into some HttpParams derivation > associated to the HttpRequest, and document the well-known key? > > HttpServletRequest other data : Likewise, I stuff this data into > HttpParams (either Basic or a specialized derivation)? > > ServletRequest host info : I grab this data, put it into an HttpHost > object, and associate it to the HttpRequest's HttpContext? > > In dealing with the HttpResponse when shipping this data back out through > the HttpServletResponse, I think I'm going to want to run the responses > interceptors as well as checking headers. If both a header and an > interceptor for that header is defined, it looks like I should err-out, > rather than prefer one over the other? > > -- Todd > --------------------------------------------------------------------- To unsubscribe, e-mail: lopezlauren@example.net For additional commands, e-mail: lopezlauren@example.net From httpclient-userslopezlauren@example.net Thu Feb 05 14:57:08 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 84279 invoked from network); 5 Feb 2009 14:57:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Feb 2009 14:57:07 -0000 Received: (qmail 59364 invoked by uid 500); 5 Feb 2009 14:57:07 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 59233 invoked by uid 500); 5 Feb 2009 14:57:06 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 59213 invoked by uid 99); 5 Feb 2009 14:57:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2009 06:57:06 -0800 X-ASF-Spam-Status: No, hits=-1.8 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lopezlauren@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO e1.ny.us.ibm.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2009 14:56:57 +0000 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [83.161.120.155]) by e1.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n15EsmLk020450 for <lopezlauren@example.net>; Thu, 5 Feb 2009 09:54:48 -0500 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [83.161.120.155]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id n15EuZQ9129532 for <lopezlauren@example.net>; Thu, 5 Feb 2009 09:56:35 -0500 Received: from d01av03.pok.ibm.com (loopback [83.161.120.155]) by d01av03.pok.ibm.com (83.161.120.15560308/8.13.3) with ESMTP id n15EuZGw007948 for <lopezlauren@example.net>; Thu, 5 Feb 2009 09:56:35 -0500 Received: from d01ml255.pok.ibm.com (d01ml255.pok.ibm.com [83.161.120.155]) by d01av03.pok.ibm.com (83.161.120.15560308/8.12.11) with ESMTP id n15EuZch007943 for <lopezlauren@example.net>; Thu, 5 Feb 2009 09:56:35 -0500 In-Reply-To: <lopezlauren@example.net> References: <lopezlauren@example.net> <lopezlauren@example.net> To: "HttpClient User Discussion" <lopezlauren@example.net> MIME-Version: 1.0 Subject: Re: Mapping javax.servlet to HttpCore - best practices questions X-KeepSent: ECCCC6F8:71983B31-85257554:005125EE; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.0.2 HF88 September 24, 2008 From: Todd W Lainhart <lopezlauren@example.net> Message-ID: <lopezlauren@example.net> Date: Thu, 5 Feb 2009 09:56:34 -0500 X-MIMETrack: Serialize by Router on D01ML255/01/M/IBM(Release 8.0.1|February 07, 2008) at 02/05/2009 09:56:34, Serialize complete at 02/05/2009 09:56:34 Content-Type: multipart/alternative; boundary="=_alternative 0052150D85257554_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 0052150D85257554_= Content-Type: text/plain; charset="US-ASCII" Hi Oleg - Thanks for the quick response. I agree that it seems odd to use the HttpCore abstractions on top of javax.servlet . Indeed, I wondered if it was just too weird to map the nominally "output" object of HttpRequest to the "input" object of HttpServletRequest that's passed to the service method. But in the case of where the servlet is acting as a proxy, and just poking that HttpRequest object to resend via HttpCore, there might be some utility there. The requirement is that the app run in a servlet/WAR, and a goal is to hide/normalize the various servlet implementations behind HttpCore, which we feel is a strong enough abstraction to promote first-class through a similar service interface to HttpServlet.service(...) (i.e. using HttpCore's HttpRequest/Response objects instead of HttpServletRequest/Response). But for reasons described in the first paragraph, and the streaming performance concerns you raise, I wonder if a better design would be to provide functions that map between ServletRequest/Response to HttpCore, when that's used on the server. I had also wondered about the performance degradation on streaming content. I thought that I might be able to somehow bridge the outputStream from HttpServletResponse to HttpResponse, but I haven't looked into that yet, or thought that through. -- Todd From: Oleg Kalnichevski <lopezlauren@example.net> To: HttpClient User Discussion <lopezlauren@example.net> Date: 02/04/2009 06:23 PM Subject: Re: Mapping javax.servlet to HttpCore - best practices questions Todd W Lainhart wrote: > I'm working on a prototype where I hide the HttpServletRequest/Response > objects and the various servlet goo-age behind HttpRequest/Response. > Imagine that a servlet is calling out to a handler of a "service(...)" > where the parameters are HttpRequest/Response, populated by the servlet > prior to calling this handler. I'm looking for best practices to do this, > based on the design of the HttpCore classes and the expectations of > clients that receive HttpRequest/Response objects. I've done > "TheGuidedTour..." and read some Javadoc. > Todd, The guided tour is somewhat outdated. There is a more recent and more complete document describing HttpCore API and its intended usage: http://hc.apache.org/httpcomponents-core/tutorial/html/ http://hc.apache.org/httpcomponents-core/tutorial/pdf/httpcore-tutorial.pdf I'll look into your questions tomorrow in details and try to give you some recommendations. However, I just cannot help wondering what it the reason for trying to put HttpCore on top of a Servlet based transport? While HTTP headers may be relatively easy to map, content streaming may be significantly more difficult to achieve without a certain performance degradation. Oleg > HttpServletRequest headers: These seem straightforward enough - I just > copy these into the headers of the HttpServletRequest. > > HttpServletRequest parameters: Based on my reading of "GuidedTour..." I'm > guessing that stuff this parameter map into some HttpParams derivation > associated to the HttpRequest, and document the well-known key? > > HttpServletRequest other data : Likewise, I stuff this data into > HttpParams (either Basic or a specialized derivation)? > > ServletRequest host info : I grab this data, put it into an HttpHost > object, and associate it to the HttpRequest's HttpContext? > > In dealing with the HttpResponse when shipping this data back out through > the HttpServletResponse, I think I'm going to want to run the responses > interceptors as well as checking headers. If both a header and an > interceptor for that header is defined, it looks like I should err-out, > rather than prefer one over the other? > > -- Todd > --------------------------------------------------------------------- To unsubscribe, e-mail: lopezlauren@example.net For additional commands, e-mail: lopezlauren@example.net --=_alternative 0052150D85257554_=-- From httpclient-userslopezlauren@example.net Thu Feb 05 16:58:10 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 88428 invoked from network); 5 Feb 2009 16:58:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Feb 2009 16:58:10 -0000 Received: (qmail 30524 invoked by uid 500); 5 Feb 2009 16:58:09 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 30498 invoked by uid 500); 5 Feb 2009 16:58:09 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 30486 invoked by uid 99); 5 Feb 2009 16:58:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2009 08:58:08 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,MISSING_MID,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail.interd4u.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2009 16:57:59 +0000 Received: (qmail 28047 invoked by uid 512); 5 Feb 2009 16:57:37 -0000 Received: from 83.161.120.155 by jupiter (envelope-from <lopezlauren@example.net>, uid 508) with qmail-scanner-1.25st (clamdscan: 0.87/1149. spamassassin: 3.1.0. Clear:RC:1(83.161.120.155):. Processed in 0.451085 secs); 05 Feb 2009 16:57:37 -0000 Received: from 93.red-80-25-178.staticip.rima-tde.net (HELO Portatil04) (lopezlauren@example.net@83.161.120.155) by jupiter with ESMTPA; 5 Feb 2009 16:57:36 -0000 From: =?iso-8859-1?Q?Joan_Balaguer=F3?= <lopezlauren@example.net> To: "'HttpClient User Discussion'" <lopezlauren@example.net> Subject: NO_HTTP_RESPONSE_EXCEPTION Date: Thu, 5 Feb 2009 17:57:28 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0055_01C987BB.36564F70" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 Thread-Index: AcmHstPy50Dq+2SJRfqWoctZ6ZEfTw== X-Qmail-Scanner-Message-ID: <123385305792228039@jupiter> X-Virus-Checked: Checked by ClamAV on apache.org Message-Id: <lopezlauren@example.net> ------=_NextPart_000_0055_01C987BB.36564F70 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, =20 I=92m sending requests to one server using HttpClient3 and HttpClient4. =20 HttpClient3 works well, but HttpClient4 fails randomly with an =91HttpNoResponseException=92. This is the trace: =20 org.apache.http.NoHttpResponseException: The target server failed to = lopezlauren@example.net(DefaultResponse= Par ser.java:85) at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser= .ja va:174) at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(A= bst ractHttpClientConnection.java:182) at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(D= efa ultClientConnection.java:235) at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader= (Ab stractClientConnAdapter.java:259) at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpReques= tEx ecutor.java:279) at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.= jav a:121) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequest= Dir ector.java:410) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient= .ja va:555) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient= .ja va:487) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient= .ja va:465) at com.vpfw.proxy.services.http.HttpService.sendRequest(HttpService.java:562= ) =20 Do you know if any other people has had a problem like this? =20 Thanks, =20 Joan. ------=_NextPart_000_0055_01C987BB.36564F70-- From httpclient-userslopezlauren@example.net Thu Feb 05 17:23:26 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 636 invoked from network); 5 Feb 2009 17:23:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Feb 2009 17:23:26 -0000 Received: (qmail 97269 invoked by uid 500); 5 Feb 2009 17:23:24 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 97246 invoked by uid 500); 5 Feb 2009 17:23:24 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 97235 invoked by uid 99); 5 Feb 2009 17:23:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2009 09:23:24 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lopezlauren@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO rv-out-0708.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2009 17:23:16 +0000 Received: by rv-out-0708.google.com with SMTP id l33so352008rvb.58 for <lopezlauren@example.net>; Thu, 05 Feb 2009 09:22:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=1MHSMEcyFNTgQhXe5qLFMiSFH7zzOxlLO46O7jT73bI=; b=s3PvE+4EA+g+TJxUrb0U2h2vsjB2b9HXbNCg8VZ208YB9/FE7IhQfYtw0iBnOk/FQr VKmoUNtPymQgBoDl+W4bh3pZX23MMj0z0Xmi6t51q4iF1Se5ooKlhImIBGVULprcemRf 7hhZBw7WQkHNRcMzY8hN6a/GCCA7GOys0AUjY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=jLOcXbNC6LpsTtqBS3kuvWOyoW9ACb3wfBScxihgFNt0p0B2wRDuePPVvT5IYvOMj+ OUf9mZCe6Dhk8WX3yBcxABO6Ec8mPto/KBKX/G/uzjRV8NUDGIBx9s9QNVLiqUOHs+XM MUZ30miYNffI7CddRratA7i6+g8DpuEp6cHzg= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id u20mr499947rve.244.1233854574967; Thu, 05 Feb 2009 09:22:54 -0800 (PST) Date: Thu, 5 Feb 2009 12:22:54 -0500 Message-ID: <lopezlauren@example.net> Subject: java.lang.IllegalArgumentException: Invalid uri From: "Ronald R. DiFrango" <lopezlauren@example.net> To: HttpClient User Discussion <lopezlauren@example.net> Content-Type: multipart/alternative; boundary=000e0cd296aca53cb104622f2726 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd296aca53cb104622f2726 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable All, I am trying to process the following URL via the HttpGet method: http://83.161.120.155/search?q=3D*&requiredfields=3D(documentLibrary:Yes).(= departmentName:HHMI+Institute-wide|departmentName:Finance)&start=3D0&num=3D= 10&access=3Dp&entqr=3D0&output=3Dxml_no_dtd&client=3DINSIDE&ud=3D1&oe=3DUTF= -8&ie=3DUTF-8&site=3Ddefault_collection&filter=3D0&getfields=3DdocumentType= .security.departmentName.userRole.documentLibrary.mimeType.pageid And I get the following exception: java.lang.IllegalArgumentException: Invalid uri ' http://83.161.120.155/search?q=3D*&requiredfields=3D(documentLibrary:Yes).(= departmentName:HHMI+Institute-wide|departmentName:Finance)&start=3D0&num=3D= 10&access=3Dp&entqr=3D0&output=3Dxml_no_dtd&client=3DINSIDE&ud=3D1&oe=3DUTF= -8&ie=3DUTF-8&site=3Ddefault_collection&filter=3D0&getfields=3DdocumentType= .security.departmentName.userRole.documentLibrary.mimeType.pageid': Invalid query Now when I cut & paste that URL into the browswer it works just fine. I am guess it is some sort of URL Encoding that needs to occur, but I am not sur= e what. Thanks, Ron --000e0cd296aca53cb104622f2726-- From httpclient-userslopezlauren@example.net Thu Feb 05 18:28:45 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 50564 invoked from network); 5 Feb 2009 18:28:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Feb 2009 18:28:45 -0000 Received: (qmail 16481 invoked by uid 500); 5 Feb 2009 18:28:43 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 16304 invoked by uid 500); 5 Feb 2009 18:28:43 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 16293 invoked by uid 99); 5 Feb 2009 18:28:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2009 10:28:43 -0800 X-ASF-Spam-Status: No, hits=4.0 required=10.0 tests=HTML_MESSAGE,MISSING_MID,SPF_PASS,SUBJ_ALL_CAPS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO mail.interd4u.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2009 18:28:35 +0000 Received: (qmail 9725 invoked by uid 512); 5 Feb 2009 18:28:08 -0000 Received: from 83.161.120.155 by jupiter (envelope-from <lopezlauren@example.net>, uid 508) with qmail-scanner-1.25st (clamdscan: 0.87/1149. spamassassin: 3.1.0. Clear:RC:1(83.161.120.155):. Processed in 0.421675 secs); 05 Feb 2009 18:28:08 -0000 Received: from 93.red-80-25-178.staticip.rima-tde.net (HELO Portatil04) (lopezlauren@example.net@83.161.120.155) by jupiter with ESMTPA; 5 Feb 2009 18:28:07 -0000 From: =?iso-8859-1?Q?Joan_Balaguer=F3?= <lopezlauren@example.net> To: "'HttpClient User Discussion'" <lopezlauren@example.net> Subject: MAX CONNECTIONS Date: Thu, 5 Feb 2009 19:28:00 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00C2_01C987C7.DC016390" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 Thread-Index: AcmHv3m+30+omJZ4Sv+QHL7MsQ2DvA== X-Qmail-Scanner-Message-ID: <12338584879229717@jupiter> X-Virus-Checked: Checked by ClamAV on apache.org Message-Id: <lopezlauren@example.net> ------=_NextPart_000_00C2_01C987C7.DC016390 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, =20 I=92m testing HttpClient4, and I=92ve found the following problem. =20 I set MaxTotalConnections to Integer.MAX_VALUE: ConnManagerParams.setMaxTotalConnections(this.objHttpParams, Integer.MAX_VALUE); =20 But when I send 5 simultaneous requests, I get 2 =93maxConnections=94 = errors. The exception is: =20 org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for lopezlauren@example.net(ConnPool= ByR oute.java:353) at org.apache.http.impl.conn.tsccm.ConnPoolByRoute$1.getPoolEntry(ConnPoolBy= Rou te.java:238) at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1.getConnecti= on( ThreadSafeClientConnManager.java:175) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequest= Dir ector.java:324) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient= .ja va:555) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient= .ja va:487) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient= .ja va:465) at com.vpfw.proxy.services.http.HttpService.sendRequest(HttpService.java:565= ) at com.vpfw.proxy.services.http.HttpService.connectServer(HttpService.java:3= 01) at com.vpfw.proxy.services.http.HttpService.connect(HttpService.java:259) at com.vpfw.proxy.servlet.ProxyUtils.byPass(ProxyUtils.java:216) at com.vpfw.proxy.servlet.ProxyServlet.service(ProxyServlet.java:449) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) =20 =20 If I print the =93maxConnections=94 value inside the exception (System.out.println(ConnManagerParams.getMaxTotalConnections(this.objHttp= Par ams))), I get: 646.665.3509. That=92s OK. =20 I suppose I=92m forgetting something. Maybe =93ConnManagerParams.setMaxConnectionsPerRoute()=94. Any help? =20 Thanks, =20 Joan. =20 =20 =20 =20 ------=_NextPart_000_00C2_01C987C7.DC016390-- From httpclient-userslopezlauren@example.net Thu Feb 05 19:12:06 2009 Return-Path: <httpclient-userslopezlauren@example.net> Delivered-To: lopezlauren@example.net Received: (qmail 67513 invoked from network); 5 Feb 2009 19:12:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Feb 2009 19:12:06 -0000 Received: (qmail 91871 invoked by uid 500); 5 Feb 2009 19:11:59 -0000 Delivered-To: lopezlauren@example.net Received: (qmail 91822 invoked by uid 500); 5 Feb 2009 19:11:59 -0000 Mailing-List: contact lopezlauren@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:lopezlauren@example.net> List-Unsubscribe: <mailto:lopezlauren@example.net> List-Post: <mailto:lopezlauren@example.net> List-Id: <httpclient-users.hc.apache.org> Reply-To: "HttpClient User Discussion" <lopezlauren@example.net> Delivered-To: mailing list lopezlauren@example.net Received: (qmail 91644 invoked by uid 99); 5 Feb 2009 19:11:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2009 11:11:59 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lopezlauren@example.net designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO rv-out-0708.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2009 19:11:50 +0000 Received: by rv-out-0708.google.com with SMTP id l33so396002rvb.58 for <lopezlauren@example.net>; Thu, 05 Feb 2009 11:11:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=QFPWBgccEC3z0qZ1wib6IhOo4yE1LZFZiFNoEIptPuI=; b=OFozNIPSjs3xtmmVPGEvOU1zab20NwTz275LUAbvS6jr3PYFR/gxGEETABC0YrxgC6 D6q3iDLSwVUBmm4DvNMWFrIaP3fR59HcW63Atb2niTVYkU7JzPU0w5npmMYgZLrTsC8e AVli/q0RSLw80q24Z+xc4D6V/n17r8Nmft6WA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=BTfP4NLSis+ikymB2XI0nWaBIySBX3LDyZx4y9SOO4Wjxqz7aJY78kWPM7NA8Q+/ZZ HWp82DR+YjnIjqlIOtreOftwZyj65Lq7m24eMFeGXgnJDSlwFZYQhwJhPvhZn4p1QlUZ 0YgeRx1Y343hSZXrwDW6qrg3/Vi16j5LzY1MQ= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id f16mr600143rvo.80.1233861089417; Thu, 05 Feb 2009 11:11:29 -0800 (PST) In-Reply-To: <lopezlauren@example.net> References: <lopezlauren@example.net> Date: Thu, 5 Feb 2009 14:11:29 -0500 Message-ID: <lopezlauren@example.net> Subject: Re: java.lang.IllegalArgumentException: Invalid uri From: "Ronald R. DiFrango" <lopezlauren@example.net> To: HttpClient User Discussion <lopezlauren@example.net> Content-Type: multipart/alternative; boundary=000e0cd1481aefd965046230ab13 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd1481aefd965046230ab13 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I solved it myself, it sees as if by default HttpClient version 3.1 assume that the client has already encoded the URL, so when it constructs a new URI, the encoding is set to true. Therefore, I had to make my construction two part: PostMethod method =3D new PostMethod(); method.setURI(new URI(baseUrl + path, false)); It would be nice if the Post, Get, etc. method constructors supported a parameter to handle this. On Thu, Feb 5, 2009
{'source': 'Apache Software Foundation Public Mail Archives'}