当前使用
solrServer = new CommonsHttpSolrServer(serverUrl);
还有这些 jar ..
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
但是 apache solr 已弃用 CommonHttpSolrServer
并建议 ConcurrentUpdateSolrServer
将 CommonHttpSolrServer
替换为 ConcurrentUpdateSolrServer
会导致运行时异常..
线程“main”中出现异常 java.lang.NoClassDefFoundError: org/apache/http/HttpRequestInterceptor
需要 jar httpcore-4.0-alpha6.jar
Exception还表示另外三个异常。
任何人都有诸如 httpcore-4.0-alpha6.jar
之类的额外 jar 的列表,需要用 ConcurrentUpdateSolrServer
替换 CommonHttpSolrServer
最佳答案
看看https://issues.apache.org/jira/browse/SOLR-3374
您需要包含 httpcore
、httpmime
和 httpclient
jar。
此外,我注意到您正在将 Solr 3.6 jar 与 Lucene 3.5 jar 一起使用 - 保持 Solr 和 Lucene jar 版本同步通常是一个好主意。
关于apache - 使用 ConcurrentUpdateSolrServer 需要哪些 jar?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10716690/