gpt4 book ai didi

spring-boot - Spring Boot 在使用 solrj 而不是 spring-boot-starter-data-solr 时爆炸

转载 作者:行者123 更新时间:2023-12-04 02:50:55 27 4
gpt4 key购买 nike

我正在尝试将现有的 Spring 应用程序移植到 Spring Boot。我使用 spring-boot-starter-data-solr 启动器,但是我的类路径上有 apache solrj (5.0.0)。

在启动过程中,应用程序崩溃了。 spring boot 似乎看到了 solr 类,并假设我在类路径上也有 spring-boot-starter-data-solr。特别是我收到此错误:

java.lang.IllegalArgumentException: @ConditionalOnMissingBean annotations must specify at least one bean (type, name or annotation)

如果我放弃 solrj 依赖项并改用 spring-boot-starter-data-solr 就可以了。但是我不需要 spring-data-solr 集成,这样做会迫使我将我们的应用程序反向移植到 4.7.x 版的 solr。

有人知道解决这个问题的方法吗?

最佳答案

看来问题是由 spring boot 对 solrj 4.7.x 的依赖引起的,而我使用的是 5.0.0

我通过使用修复了它

@SpringBootApplication(exclude = {SolrAutoConfiguration.class})

告诉启动完全忽略 SolrAutoConfiguration。

关于spring-boot - Spring Boot 在使用 solrj 而不是 spring-boot-starter-data-solr 时爆炸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29520654/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com