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
This commit is contained in:
Phillip Webb
2014-06-18 16:30:39 -07:00
parent a2efe17fc9
commit 34a32991fa

View File

@@ -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 {