SolrJ HttpSolrServer throws a NoHttpResponseException during instance creation

SolrJ throws a NoHttpResponseException when trying to instantiate an HttpSolrServer. Does anyone know why?

In the code I'm doing:

SolrServer server = new HttpSolrServer ("http://localhost:8983/solr/"); // or some other url.

and he throws:

 javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/http/NoHttpResponseException

I am using Solr and SolrJ 4.1.0

+5
source share
5 answers

I don’t know if your problem was the same as mine, but I thought I was getting the same exception until I noticed that I had an exception noClassFound :NoHttpResponseExceptionand just adding this package httpclient-4.1.3, the problem was solved. hope this helps.

+6
source

, solrj-4.3.1. org.apache.httpcomponents:httpcore jar .

httpcore-4.2.5.jar

+3

httpclient-4.x.x. , solr-4.4.0, dist. .

+2

, . , httpclient-.jar httpcore-.jar. ,

+1

, 3 . 1. httpclient 2. httpcore 3. httpmime

solr. solr4.7.2, solr-4.7.2\dist\solrj-lib\

+1

All Articles