From 34a32991fa19ba65127d41389216f9e1abab5641 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 18 Jun 2014 16:30:39 -0700 Subject: [PATCH] Be defensive about solr classes required Update SolrAutoConfiguration to specifically require HttpSolrServer and CloudSolrServer classes rather than the generic SolrServer. This prevents the rather cryptic "@ConditionalOnMissingBean annotations must specify at least one bean" error that can occur if an earlier version of solr happens to be on the classpath (as is the case when hibernate-search is used). Fixes gh-1098 --- .../boot/autoconfigure/solr/SolrAutoConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/solr/SolrAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/solr/SolrAutoConfiguration.java index d4fa3951ec..fe2c95bbb4 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/solr/SolrAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/solr/SolrAutoConfiguration.java @@ -37,7 +37,7 @@ import org.springframework.util.StringUtils; * @since 1.1.0 */ @Configuration -@ConditionalOnClass(SolrServer.class) +@ConditionalOnClass({ HttpSolrServer.class, CloudSolrServer.class }) @EnableConfigurationProperties(SolrProperties.class) public class SolrAutoConfiguration {