Repository: nutch
Updated Branches:
  refs/heads/NUTCH-2292 82b03bc15 -> 2175c767c (forced update)


NUTCH-2267 - Solr and Hadoop JAR mismatch

Explicitly pass in an instance of SystemDefaultHttpClient to CloudSolrClient, 
otherwise SolrJ will use a default implementation of CloseableHttpClient, which 
is not present in the HttpClient and HttpCore JARs in Hadoop < 2.8 (see 
https://issues.apache.org/jira/browse/SOLR-7948 and 
https://issues.apache.org/jira/browse/HADOOP-12767).

Project: http://git-wip-us.apache.org/repos/asf/nutch/repo
Commit: http://git-wip-us.apache.org/repos/asf/nutch/commit/f64686bb
Tree: http://git-wip-us.apache.org/repos/asf/nutch/tree/f64686bb
Diff: http://git-wip-us.apache.org/repos/asf/nutch/diff/f64686bb

Branch: refs/heads/NUTCH-2292
Commit: f64686bb06cec2e31c9560d7e7e7f050311d62f1
Parents: d29be63
Author: Steven <[email protected]>
Authored: Mon Jun 27 09:30:52 2016 -0400
Committer: GitHub <[email protected]>
Committed: Mon Jun 27 09:30:52 2016 -0400

----------------------------------------------------------------------
 .../src/java/org/apache/nutch/indexwriter/solr/SolrUtils.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nutch/blob/f64686bb/src/plugin/indexer-solr/src/java/org/apache/nutch/indexwriter/solr/SolrUtils.java
----------------------------------------------------------------------
diff --git 
a/src/plugin/indexer-solr/src/java/org/apache/nutch/indexwriter/solr/SolrUtils.java
 
b/src/plugin/indexer-solr/src/java/org/apache/nutch/indexwriter/solr/SolrUtils.java
index eec0080..85a9c4c 100644
--- 
a/src/plugin/indexer-solr/src/java/org/apache/nutch/indexwriter/solr/SolrUtils.java
+++ 
b/src/plugin/indexer-solr/src/java/org/apache/nutch/indexwriter/solr/SolrUtils.java
@@ -22,6 +22,7 @@ import java.util.List;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.hadoop.mapred.JobConf;
+import org.apache.http.impl.client.SystemDefaultHttpClient;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
@@ -60,7 +61,8 @@ public class SolrUtils {
   }
 
   public static CloudSolrClient getCloudSolrClient(String url) throws 
MalformedURLException {
-    CloudSolrClient sc = new CloudSolrClient(url.replace('|', ','));
+    SystemDefaultHttpClient httpClient = new SystemDefaultHttpClient();
+    CloudSolrClient sc = new CloudSolrClient(url.replace('|', ','), 
httpClient);
     sc.setParallelUpdates(true);
     sc.connect();
     return sc;

Reply via email to