commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc.Saeges...@apropos.com
Subject RE: HTTP Client of Jakarta Commons Parsing Error
Date Sun, 28 Apr 2002 16:31:24 GMT
Sam,

Don't know what to tell you.  My simple page getting application is
attached.  Try running Ethereal and see what the server is actually sending
back.


Marc Saegesser 

> -----Original Message-----
> From: Samuel Cheung [mailto:SCheung@Novarra.com]
> Sent: Sunday, April 28, 2002 11:17 AM
> To: 'Jakarta Commons Developers List'
> Subject: RE: HTTP Client of Jakarta Commons Parsing Error
> 
> 
> Marc,
> 
> This is my test code. But I still got the exception
> org.apache.commons.httpclient.HttpException:
> org.apache.commons.httpclient.HttpRecoverableException
> 
> public static void test(String[] args) throws Exception {
> 		HttpMultiClient hc = new HttpMultiClient();
> 		UrlGetMethod ugm = new
> UrlGetMethod("http://realestate.yahoo.com");
> 		ugm.setStrictMode(false);
> 		int rc = hc.executeMethod(ugm);
> 		System.out.println(rc);
> }
> 
> Thanks.
> Sam
> 
> 2002-04-28 11:13:44,836 [main] DEBUG
> org.apache.commons.httpclient.HttpConnectionManager -
> HttpConnectionManager.releaseConnection:  Release connection for
> realestate.yahoo.com:80
> org.apache.commons.httpclient.HttpException:
> org.apache.commons.httpclient.HttpRecoverableException: Error 
> in parsing the
> status line from the response: unable to find line starting 
> with "HTTP/"
> 	at
> org.apache.commons.httpclient.HttpMethodBase.execute(HttpMetho
dBase.java:476
> )
> 	at
> org.apache.commons.httpclient.HttpMultiClient.executeMethod(Ht
tpMultiClient.
> java:239)
> 	at TestHTTPClient.test(TestHTTPClient.java:36)
> 	at TestHTTPClient.main(TestHTTPClient.java:10)
> Exception in thread "main" 
> 
> 
> -----Original Message-----
> From: Marc.Saegesser@apropos.com [mailto:Marc.Saegesser@apropos.com]
> Sent: Sunday, April 28, 2002 11:14 AM
> To: commons-dev@jakarta.apache.org
> Subject: RE: HTTP Client of Jakarta Commons Parsing Error
> 
> 
> I just tried it using my HttpMultiClient test application and 
> it workekd
> fine.  The url http://realestate.yahoo.com does an offsite redirect to
> http://list.reaslestate.yahoo.com which won't using the basic 
> HttpClient.
> You either need to handle the resulting 302 result or use 
> HttpMultiClient.
> 
> I don't know why you're aren't seeing the HTTP response 
> status line since it
> works fine for me.
> 
> 
> Marc Saegesser 
> 
> > -----Original Message-----
> > From: Samuel Cheung [mailto:SCheung@Novarra.com]
> > Sent: Sunday, April 28, 2002 10:47 AM
> > To: commons-dev@jakarta.apache.org
> > Subject: HTTP Client of Jakarta Commons Parsing Error
> > 
> > 
> > Hi, 
> > 
> > I am using the latest HTTP client latest build. I got the 
> > following error
> > when I execute URL get method for the site 
> > "http://realestate.yahoo.com". I
> > try other sites (e.g. "http://www.yahoo.com"), they work. but
> > "http://realestate.yahoo.com" fails.
> > 
> > 
> > org.apache.commons.httpclient.HttpException:
> > org.apache.commons.httpclient.HttpRecoverableException: Error 
> > in parsing the
> > status line from the response: unable to find line starting 
> > with "HTTP/"
> > at
> > org.apache.commons.httpclient.HttpMethodBase.execute(HttpMetho
> > dBase.java:476
> > )
> > at
> > org.apache.commons.httpclient.HttpClient.executeMethod(HttpCli
> > ent.java:301)
> > at TestHTTPClient.main(TestHTTPClient.java:20)
> > Exception in thread "main" 
> > 
> > My Test code:
> > 
> > public class TestHTTPClient {
> > 
> > 	public static void main(String[] args) throws Exception {
> > 	
> > PropertyConfigurator.configure("C:\\pir\\junitTestCase\\wipe\\
> > log4j.conf");
> > 
> > 		HttpClient hc = new HttpClient();
> > 		UrlGetMethod ugm = new
> > UrlGetMethod("http://realstate.yahoo.com");
> > 		ugm.setStrictMode(false);
> > 		hc.startSession(new URL("http://realestate.yahoo.com"));
> > 		int rc = hc.executeMethod(ugm);
> > 		System.out.println(rc);
> >      }
> > }
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: 
> > <mailto:commons-dev-help@jakarta.apache.org>
> > 
> 
> --
> To unsubscribe, e-mail:
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:commons-dev-help@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:   
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:commons-dev-help@jakarta.apache.org>
> 
  


Mime
View raw message