我在初始化ConcurrentUpdateSolrClient对象时遇到java.lang.NoSuchMethodError

时间:2016-03-04 11:15:32

标签: java apache-httpclient-4.x solrj solr5

我通过调用

初始化ConcurrentUpdateSolrClient对象时收到java.lang.NoSuchMethodError
ConcurrentUpdateSolrClient _server = new ConcurrentUpdateSolrClient(url, 10, 4);

我正在使用的Jar文件

httpcore-4.4.1.jar
httpclient-4.4.1.jar

在控制台中记录以下错误

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.http.util.VersionInfo.getUserAgent(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/String;
    at org.apache.http.impl.client.DefaultHttpClient.setDefaultHttpParams(DefaultHttpClient.java:184)
    at org.apache.http.impl.client.DefaultHttpClient.createHttpParams(DefaultHttpClient.java:159)
    at org.apache.http.impl.client.AbstractHttpClient.getParams(AbstractHttpClient.java:466)
    at org.apache.solr.client.solrj.impl.HttpClientUtil.setFollowRedirects(HttpClientUtil.java:290)
    at org.apache.solr.client.solrj.impl.HttpClientConfigurer.configure(HttpClientConfigurer.java:58)
    at org.apache.solr.client.solrj.impl.HttpClientUtil.configureClient(HttpClientUtil.java:149)
    at org.apache.solr.client.solrj.impl.HttpClientUtil.createClient(HttpClientUtil.java:125)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.<init>(HttpSolrClient.java:188)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.<init>(HttpSolrClient.java:165)
    at org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient.<init>(ConcurrentUpdateSolrClient.java:127)
    at org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient.<init>(ConcurrentUpdateSolrClient.java:119)
    at org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient.<init>(ConcurrentUpdateSolrClient.java:109)
    at org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient.<init>(ConcurrentUpdateSolrClient.java:102)
    at com.etl.extract.ExtractData.<init>(ExtractData.java:34)
    at com.etl.base.LaunchExtract.main(LaunchExtract.java:11)

如果有人已经遇到过这个问题并且已经解决,请告诉我!

感谢。

0 个答案:

没有答案