hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Madeleine Wright <m.wri...@ru.ac.za>
Subject problem with version 3?
Date Mon, 22 Nov 2004 12:55:30 GMT
I have no problem with running code using version  2.0.1.  I have just 
tried running (suitably amended) code with version 3 and I get an error 
I can't explain.  The main code as far as the problem is:
        String url = "http://www.apache.org";
        HttpClient client = new HttpClient();
        client.getParams().setAuthenticationPreemptive(true);
        AuthScope as = new AuthScope("host", portnum);
        Credentials creds = new UsernamePasswordCredentials("user", 
"password");
        client.getState().setProxyCredentials(as, creds);
        client.getHostConfiguration().setProxy("host", hostNum);
        
client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,new 
DefaultHttpMethodRetryHandler(1, false));
       
        setProperty("org.apache.commons.logging.Log", 
"org.apache.commons.logging.impl.SimpleLog");
        setProperty("org.apache.commons.logging.simplelog.showdatetime", 
"true");
        
setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire.header", 
"debug");
        
setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", 
"debug");
       
        GetMethod method = new GetMethod(url);

It all compiles OK but the problem is with the last line (?), where it 
throws the following exception:
    Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/commons/codec/DecoderException
    at 
org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:217)
    at 
org.apache.commons.httpclient.methods.GetMethod.<init>(GetMethod.java:88)
    at FileFinder.main(FileFinder.java:60)

Can anyone tell me what this means, please?  Surely it finds the 
GetMethod class???

Thanks.

Madeleine


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org


Mime
View raw message