Madeleine, As of version 3.0 HttpClient requires Commons Codec library as a runtime dependency:
http://jakarta.apache.org/commons/codec/ Hope this helps Oleg On Mon, Nov 22, 2004 at 02:55:30PM +0200, Madeleine Wright wrote: > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]