Which jars are needed to use ConcurrentUpdateSolrS

2019-07-20 06:56发布

问题:

Currently using

solrServer = new CommonsHttpSolrServer(serverUrl);

and with these jars..

apache-solr-core-3.6.0
apache-solr-solrj-3.6.0
commons-codec-1.6
commons-httpclient-3.1
commons-io-2.1
jcl-over-slf4j-1.6.1
slf4j-api-1.6.1
slf4j-jdk14-1.6.1
lucene-core-3.5.0

However apache solr deprecated CommonHttpSolrServer and suggested ConcurrentUpdateSolrServer
Replacing CommonHttpSolrServer by ConcurrentUpdateSolrServer gives runtime exception ..


Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/HttpRequestInterceptor

which needs the jar httpcore-4.0-alpha6.jar
Exception also indicate three more exceptions.
Anybody having list of which extra jars like httpcore-4.0-alpha6.jar are needed to replace CommonHttpSolrServer by ConcurrentUpdateSolrServer

回答1:

Take a look at https://issues.apache.org/jira/browse/SOLR-3374 You need to include httpcore, httpmime and httpclient jars.

Also, I noticed that you are using Solr 3.6 jars with Lucene 3.5 jars - it is generally a good idea to keep Solr and Lucene jar versions in sync.