Return-Path: Delivered-To: apmail-jakarta-httpclient-user-archive@www.apache.org Received: (qmail 30354 invoked from network); 26 Apr 2007 13:57:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Apr 2007 13:57:13 -0000 Received: (qmail 81002 invoked by uid 500); 26 Apr 2007 13:57:19 -0000 Delivered-To: apmail-jakarta-httpclient-user-archive@jakarta.apache.org Received: (qmail 80989 invoked by uid 500); 26 Apr 2007 13:57:18 -0000 Mailing-List: contact httpclient-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: "HttpClient User Discussion" Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-user@jakarta.apache.org Received: (qmail 80973 invoked by uid 99); 26 Apr 2007 13:57:18 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 06:57:18 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [85.90.206.104] (HELO office.redwerk.com) (85.90.206.104) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 06:57:10 -0700 Received: from bofh by office.redwerk.com with local (Exim 4.66 (FreeBSD)) (envelope-from ) id 1Hh4Sl-0003vH-0d for httpclient-user@jakarta.apache.org; Thu, 26 Apr 2007 16:56:47 +0300 Date: Thu, 26 Apr 2007 16:56:46 +0300 From: Eugeny N Dzhurinsky To: httpclient-user@jakarta.apache.org Subject: Unable to parse header : HTTP/1.1 200 OK Message-ID: <20070426135646.GA15031@office.redwerk.com> Mail-Followup-To: httpclient-user@jakarta.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.5.15 (2007-04-06) X-Virus-Checked: Checked by ClamAV on apache.org Hello! I'm facing strange issue: import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpMethod; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.log4j.BasicConfigurator; import org.apache.log4j.Level; import org.apache.log4j.Logger; import junit.framework.TestCase; /** * Tests HttpClient */ public class TestHttpclient extends TestCase { public void testHttpClient() throws Exception { BasicConfigurator.configure(); Logger.getRootLogger().setLevel(Level.ERROR); Logger.getLogger("httpclient.wire.header").setLevel(Level.DEBUG); HttpClient client = new HttpClient(); HttpMethod method = new GetMethod("http://www.archbiocides.com/"); method.setFollowRedirects(true); client.executeMethod(method); assertEquals(HttpStatus.SC_OK, method.getStatusCode()); } } 0 [main] DEBUG httpclient.wire.header - >> "GET / HTTP/1.1[\r][\n]" 36 [main] DEBUG httpclient.wire.header - >> "User-Agent: Jakarta Commons-HttpClient/3.1-rc1[\r][\n]" 37 [main] DEBUG httpclient.wire.header - >> "Host: www.archbiocides.com[\r][\n]" 37 [main] DEBUG httpclient.wire.header - >> "[\r][\n]" 313 [main] DEBUG httpclient.wire.header - << "HTTP/1.1 302[\r][\n]" org.apache.commons.httpclient.ProtocolException: Unable to parse header: HTTP/1.1 200 OK at org.apache.commons.httpclient.HttpParser.parseHeaders(HttpParser.java:192) at org.apache.commons.httpclient.HttpMethodBase.readResponseHeaders(HttpMethodBase.java:1927) at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1729) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1090) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) at TestHttpclient.testHttpClient(TestHttpclient.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) I understand something might be wrong for the website and the protocol might be corrupted, but as soon as mozilla/IE browsers are displaying the website fine, we need to get some workaround. Could you please suggest something, which will not lead us to modifying Httpclient sources? I've read about error handling for protocol errors, but I just found it is possible to force HttpClient to retry this url again and again. In such case as described above this will lead to a infinite loop unless we will still handle this error (which isn't an error in our case). We are using HttpClient 3.01 and 3.1-RC1, with same results. -- Eugene N Dzhurinsky --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-user-help@jakarta.apache.org