Annotation-specified bean name ‘mongoConfig’ for bean class [com.lxw.manage.cms.client.config.MongoConfig] conflicts with existing, non-compatible bean definition of same name and class
注解指定的Bean存在冲突,我这里是因为重复定义了。如下图:在开发cms模块的时候需要用到RabbitMQConfig,看到client模块有这个配置,就直接在cms模块依赖了client模块。没留意到这两个模块都有MongoConfig的配置,导致Bean的重复定义。
解决方案:解除cms模块对client模块的依赖即可,开发过程中要尽量避免各模块之间的依赖,这是微服务框架的初衷,也是高内聚低耦合的体现。
Annotation-specified bean name ‘mongoConfig‘ for bean class XX conflicts with existing
最新推荐文章于 2023-03-02 16:27:11 发布