Using Solrj to connect to solr indexes. Used jar solr-solrj-3.6.1.jar which I got by adding below maven dependency
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>3.6.1</version>
</dependency>
I see that CommonsHttpSolrServer is deprecated and hence using HttpSolrServer . During run time i get the below error, Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient
Just adding solr-solrj-3.6.1.jar is not sufficient? Should I have to add more dependencies? I also tried adding httpclient 4.1, It started asking for org/apache/http/HttpRequestInterceptor.
Added below dependencies to get this working
Add this package to your maven dependencies:
My simple project of solrj uses the following dependencies:
Between, Maven can automatically download them (for example, I started the Java Application of Maven in NetBeans, and then just added the dependencies). Additionally, I needed just to download the library of commons-logging 1.1.3 (http://commons.apache.org/proper/commons-logging/download_logging.cgi). You can read more about libraries and dependencies here: (http://wiki.apache.org/solr/Solrj).