hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neelesh Bodas" <neelesh.bo...@gmail.com>
Subject Logging related problems with HttpClient
Date Thu, 22 Jun 2006 17:55:51 GMT

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 :

[(I have made this list based on the dependency list given on HttpClient page)

I am getting the following runtime error:

Exception in thread "main" java.lang.NoClassDefFoundError:
      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


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

View raw message