ACE-2857: Solr 4: Index backup fails.

Fixed to use XML rather than the javabin protocol. Will revert if it is a performance issue.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@85554 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2014-09-23 18:10:51 +00:00
parent df4b037784
commit ab8bd84a7b

View File

@@ -36,6 +36,7 @@ import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
import org.apache.solr.client.solrj.impl.XMLResponseParser;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.NamedList;
@@ -159,6 +160,7 @@ public class SOLRAdminClient implements ApplicationEventPublisherAware, Disposab
HttpClient httpClient = httpClientFactory.getHttpClient();
server = new CommonsHttpSolrServer(solrUrl, httpClient);
server.setParser(new XMLResponseParser());
// TODO remove credentials because we're using SSL?
Credentials defaultcreds = new UsernamePasswordCredentials(solrUser, solrPassword);
server.getHttpClient().getState().setCredentials(new AuthScope(solrHost, solrPort, AuthScope.ANY_REALM),