Hi Everyone, I am trying to use SolrJ to add docs to Solr. The following line:
HttpSolrClient solrServer = new HttpSolrClient(" http://localhost:8983/solr"); Is failing with exception: Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory at org.apache.http.impl.client.CloseableHttpClient.<init>(CloseableHttpClient.java:60) at org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:271) at org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:127) . . . . . . . . . . . Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory at java.net.URLClassLoader.findClass(URLClassLoader.java:665) at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:942) at java.lang.ClassLoader.loadClass(ClassLoader.java:851) . . . . . . . . . . . I pulled in everything from \solr-5.1.0\dist\solrj-lib and I included "solr-solrj-5.1.0.jar" from "\solr-5.1.0\dist". Why I'm getting the above error? Is there an external JAR I need? I want to pull in required JARs only. Google'ing the issue suggest I need to include "org-apache-commons-logging.jar" (and few other JARs) but this JAR is not part of Solr's distribution so I"m not willing to do so blindly. Thanks Steve