【发布时间】:2017-10-20 02:30:30
【问题描述】:
我修改了 spring-cloud-config-server-mongodb 项目以使用最新版本的 Spring Boot (1.5.3.RELEASE) 和 Spring Cloud Config (1.3.0.RELEASE)。 我还介绍了运行 mongo db 配置服务器的 MongoConfigServer 类。
当我运行它时,我得到了这个错误:
org.springframework.beans.factory.NoUniqueBeanDefinitionException:
No qualifying bean of type
'org.springframework.cloud.config.server.environment.EnvironmentRepository' available:
more than one 'primary' bean found among candidates: [searchPathLocator, environmentRepository, searchPathCompositeEnvironmentRepository]
我不确定我做错了什么。如何编写自己的配置服务器而不会出现此错误? 我没有看到任何有关如何执行此操作的文档。
有人可以帮助我,或指导我吗?
这个 mongo db 配置服务器用于使用旧版本的 Spring Boot 和 Spring Cloud Config。 我使用这个 Mongo DB 配置服务器作为编写不同配置服务器的示例,它也收到相同的错误。
我的 spring-cloud-config-server-mongodb 分支在 https://github.com/minmay/spring-cloud-config-server-mongodb.git 可用
【问题讨论】:
标签: spring spring-boot spring-cloud-config