Spring @bean冲突解决方案
发布日期:2021-06-30 19:00:21
浏览次数:3
分类:技术文章
本文共 642 字,大约阅读时间需要 2 分钟。
引用2个jar都实现了相同的@bean注入,这个是feign的Level
@Beanpublic Level feignLoggerLevel() { return Level.FULL;}
这样报错:
escription:xxx required a single bean, but 2 were found: - feignLoggerLevel: defined by method 'feignLoggerLevel' in class path resource [com/xxx.class] - logger: defined by method 'logger' in class path resource [com/yyy.class]Action:Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
解决办法:
@Bean @ConditionalOnMissingBean(Logger.Level.class) public Level feignLoggerLevel() { return Level.FULL;}
转载地址:https://linuxstyle.blog.csdn.net/article/details/114756122 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
哈哈,博客排版真的漂亮呢~
[***.90.31.176]2024年04月16日 13时01分07秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
tf keras Dense源码解析
2019-04-30
tf rnn输入输出的维度和权重的维度
2019-04-30
检验是否服从同一分布
2019-04-30
tf callbacks
2019-04-30
keras、tf、numpy实现logloss对比
2019-04-30
Ubuntu20.04安装微信
2019-04-30
Restful风格的使用
2019-04-30
Swagger基础入门整合SpringBoot
2019-04-30
MyBatisPlus简单入门(SpringBoot)
2019-04-30
攻防世界web进阶区NewsCenter详解
2019-04-30
攻防世界web进阶PHP2详解
2019-04-30
如何解决词达人问题(新)
2019-04-30
攻防世界web进阶区surpersqli详解
2019-04-30
攻防世界web进阶区easytornado详解
2019-04-30
攻防世界web进阶区web2详解
2019-04-30
xss-labs详解(上)1-10
2019-04-30
xss-labs详解(下)11-20
2019-04-30
攻防世界web进阶区ics-05详解
2019-04-30
攻防世界web进阶区FlatScience详解
2019-04-30
攻防世界web进阶区ics-04详解
2019-04-30