Hello,

I am having problems while using HttpClient. Here is a sample code :

package src.com.example.web;
// all necessary imports
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.*;
import org.apache.commons.httpclient.params.HttpMethodParams;


public class Sample {

      private static String url = "http://www.apache.org/";;

        public static void main(String[] args) {
          // Create an instance of HttpClient.
          HttpClient client = new HttpClient();

        }
}

I have made sure that following jars are in the classpath :
commons-codec-1.3.jar
commons-logging-1.1.jar
commons-logging-adapters-1.1.jar
commons-logging-api-1.1.jar
junit-4.1.jar
commons-httpclient-3.0.1.jar

I am getting the following runtime error:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/logging/LogFactory
      at org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:65)
      at src.com.example.web.Sample.main(Sample.java:12)

I have also tried using log4j but that didnot solve the problem. (As
an aside I am using Java 5.0 so I thing the logging facility provided
by java.util should be fine)

Any pointers regarding how to remove this error and get the code working?

Thanks in Advance

~Neelesh

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to