问题
在配置类中,有两个要自动注入的bean,其中一个是单机的SolrClient类型的变量,另一个是集群的SolrClient类型的变量,由于SpringdataSolr中SolrTemplate需要注入一个SolrClient的对象,此时出现问题
Error creating bean with name 'solrTemplate' defined in com.jcl.SolrApplication:
Unsatisfied dependency expressed through method 'solrTemplate' parameter 0;
nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException:
No qualifying bean of type 'org.apache.solr.client.solrj.SolrClient' available:
expected single matching bean but found 2:
creatHttpSolrClient,cloudSolrClient