I have an app that is pulling from about 6 different sites, all work but one
site.  I get the following messages:

The Console:

Jun 6, 2003 3:14:34 PM org.apache.commons.httpclient.HttpMethodBase
processRequest  INFO: Recoverable exception caught when processing request

Jun 6, 2003 3:14:34 PM org.apache.commons.httpclient.HttpMethodBase
processRequest  WARNING: Recoverable exception caught but
MethodRetryHandler.retryMethod() returned false, rethrowing exception

 

The exception:

            Fri Jun 06 15:14:34 EDT
2003,org.apache.commons.httpclient.HttpRecoverableException: Error in
parsing the status line from the response: unable to find line starting with
"HTTP"

 

The Results:

            Unexpected failure

 

The Code:

                String url = "/jobseeker/jobs/jobfindall.asp";

        HttpClient client = new HttpClient();

 
client.getHostConfiguration().setHost("www.careerbuilder.com",80,"http");

        HttpState httpstate = new HttpState();

        client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);

        Header cjheader = new Header();

        String responseBody = null;

        org.apache.commons.httpclient.Cookie[] cookies = null;

//        jobServlet.tools.writeLog("Initialized CJ Vars.");

 

        client.setConnectionTimeout(30000); //30 seconds

        Header[] requestHeaders = new Header[15];

        GetMethod get = new GetMethod(url);

        get.setFollowRedirects(true);

        get.setStrictMode(false);

        get.setHttp11(false);

        client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);

        try{

//            jobServlet.tools.writeLog("Executing CB Get");

            int iResultCode = client.executeMethod(get);

//            jobServlet.tools.writeLog("Get Result Code: " + iResultCode);

            httpstate = client.getState();

            responseBody = get.getResponseBodyAsString();

//            jobServlet.tools.writeLog("Getting Cookies and Headers");

            cookies = httpstate.getCookies();

            requestHeaders = get.getRequestHeaders();

        }

        catch (HttpException he) {

            jobServlet.tools.writeLog("Http error connecting to '" + url +
"'");

            jobServlet.tools.writeLog(he.getMessage());

        }

        catch (IOException ioe){

            jobServlet.tools.writeLog("Unable to connect to '" + url + "'");

        }

        catch (NullPointerException np) {

            jobServlet.tools.writeLog("Null Status: " + np.getMessage());

        }

 

Any ideas?  I'm using the Beta 2 release.  It looks similar to bug 19635,
but it's a different GET so I'm not sure.  

 

Ross Rankin

 

 

Reply via email to