Hi Steve,
You can find list of dependencies in its pom: http://central.maven.org/maven2/org/apache/solr/solr-solrj/5.1.0/solr-solrj-5.1.0.pom

It would be best if you use some dependency management tool. You can use it in separate project to create all-in-one jar and than include that one in your project, but there is always chance it will collide with other project jars.

Thanks,
Emir

--
Monitoring * Alerting * Anomaly Detection * Centralized Log Management
Solr & Elasticsearch Support * http://sematext.com



On 12.05.2015 20:33, Steven White wrote:
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


--
Monitoring * Alerting * Anomaly Detection * Centralized Log Management
Solr & Elasticsearch Support * http://sematext.com/

Reply via email to