Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 92354 invoked from network); 2 May 2002 14:33:14 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 2 May 2002 14:33:14 -0000 Received: (qmail 11116 invoked by uid 97); 2 May 2002 14:33:14 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@nagoya.betaversion.org Received: (qmail 11002 invoked by alias); 2 May 2002 14:33:13 -0000 Delivered-To: jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 10981 invoked by uid 97); 2 May 2002 14:33:13 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 10966 invoked by uid 98); 2 May 2002 14:33:12 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) From: "Allistair Crossley" To: Subject: HttpClient Hanging on executeMethod(HttpMethod) Date: Thu, 2 May 2002 15:30:05 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi All, I am going to paste a block of code below. I am trying to post to a URL and what happens is it hangs on httpClient.executeMethod(PostMethod). I am not sure why this could be and so am hoping you may be able to help. What is even more weird is that I expected after an interval the try..catch block to catch something like a NoRouteToHost or UnknownHost exception but nothing happens....it is definately hanging at the executeMethod statment as I never get to the System.print after it. Your help appreciated, Ali // create http client post PostMethod postMethod = new PostMethod(); postMethod.setPath("/ugo.asp"); // process out and add params to post StringTokenizer t = new StringTokenizer(postString, "&"); //abc=123&def=456 while(t.hasMoreTokens()) { String pair = removePercent20(t.nextToken()); //abc=123 System.out.println("IntegrationQueueClient: name/val pair; " + pair); int equals = pair.indexOf("="); //postMethod.addParameter(pair.substring(0, equals), pair.substring(equals + 1)); } // establish connection to server and post HttpClient httpClient = new HttpClient(); httpClient.startSession("123.456.78.9", 80); System.out.println("IntegrationQueueClient: session started"); httpClient.executeMethod(postMethod); System.out.println("IntegrationQueueClient: ending session"); httpClient.endSession(); System.out.println("IntegrationQueueClient: session ended"); //System.out.println("IntegrationQueueClient: " + postMethod.getResponseBodyAsString()); } catch(Exception e) { System.out.println("IntegrationQueueClient: " + e); } Allistair Crossley Lead Technical Developer Obvious Solutions (Global) Ltd. �Delivering the vision for a mobile lifestyle� www.obvioussolutions.co.uk (m) +44 (0) 7884 056 274 (w) +44 (0) 20 8451 9352 (f) +44 (0) 20 8537 5236 /******************************************/ This is an email from Obvious Solutions (Global) Ltd. The contents of this email are confidential to the ordinary user of the email address to which it was addressed. No-one else may copy or forward all or any of it in any form. If you receive this email in error, we should be obliged if you would telephone our postmaster on +44 (0)208 357 8352 or email postmaster@obvious.uk.com. Thank you. -- To unsubscribe, e-mail: For additional commands, e-mail: