Hello,
So I get the exact URLs that are throwing the HttpException related to parsing the
status line, plugged them into your Example, and they, too, passed.
Perhaps I am using HTTP Client wrong.
Here is how I am using HTTP Client:
// constructor
public JakartaHTTPClientFetcher(int timeout)
throws FetcherException, IllegalArgumentException
{
if (timeout < 0)
throw new IllegalArgumentException("Timeout cannot be negative");
_httpClient = new HttpClient();
_httpMethod = new GetMethod();
}
// this is how I fetch pages
public InputStream getBodyAsInputStream(String path)
throws FetcherException
{
if ((_host == null) || _host.equals("") || (_port < 1))
throw new FetcherException("Host and port must be set before
documents can be fetched");
try
{
_httpClient.startSession(_host, _port);
_httpMethod.recycle();
_httpMethod.setPath(path);
_httpStatusCode = _httpClient.executeMethod(_httpMethod);
if (_httpStatusCode >= 300)
{
return null;
}
else
return _httpMethod.getResponseBodyAsStream();
}
catch (IOException e)
{
logMan.log(logCat, LogManager.ERROR, "IOException: " +
e.getMessage());
throw new FetcherException("IOException thrown while fetching from
" +
_host + ":" + _port + path, e);
}
catch (HttpException e)
{
logMan.log(logCat, LogManager.ERROR, "HttpException: " +
e.getMessage());
throw new FetcherException("HttpException thrown while fetching
from " +
_host + ":" + _port + path, e);
}
catch (UnsupportedOperationException e)
{
logMan.log(logCat, LogManager.ERROR,
"UnsupportedOperationException: " + e.getMessage());
throw new FetcherException("UnsupportedOperationException thrown
while fetching from " +
_host + ":" + _port + path, e);
}
}
In the above catch(HttpExceptione e) block is where I am catching that "Error in
parsing the status line..." message.
I am also calling this method to close the connection:
public void closeConnection()
throws CloseConnectionException
{
try
{
_httpClient.endSession();
}
catch (IOException e)
{
throw new CloseConnectionException("IOException caught", e);
}
}
Am I doing something wrong?
Thanks,
Otis
On Thu, 06 December 2001, "Rodney Waldhoff" wrote:
>
> I don't see it. Attached is a simple test case that hits each of the
> servers you listed. They all work fine for me. (I also get the response I
> would expect--i.e., including "HTTP/1.x" as the first part of the status
> line) from a telnet session against those servers as well.)
>
> One simple way to run the attached test is to drop it into you HttpClient
> source tree at <jakarta-commons-root>/httpclient/src/test/Examples.java, and
> run:
>
> ant -Dtest.entry=Examples test
>
> from the httpclient directory. Do this test fail for you? Can you provide
> one that does?
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
_________________________________________________________________
iVillage.com: Solutions for Your Life
Check out the most exciting women's community on the Web
http://www.ivillage.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>