背景:
调用HttpSolrClient server = new HttpSolrClient.Builder(SOLR_URL).withConnectionTimeout(10000) .withSocketTimeout(60000).build();
操作solr时,报出NoSuchMethodError异常
方法调用没问题。
原因:httpclient版本太低,提高httpclient版本
解决办法:
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.6</version>
</dependency>
将版本升到4.5.6可以了