Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException:

本文深入探讨了在Spring或Spring Boot框架中,由于定义了同名的两个bean所引发的ConflictingBeanDefinitionException异常。详细分析了错误原因,并提供了检查与解决此类问题的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'segmentDeductionControl' for bean class [com.icongtai.yamei.tji.core.stream.cal.impl.SegmentDeductionControl] conflicts with existing, non-compatible bean definition of same name and class [com.icongtai.yamei.tji.core.service.inner.impl.SegmentDeductionControl]
	at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:348)
	at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:286)
	at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132)
	at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:288)
	at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245)
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:202)
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:170)
	... 37 common frames omitted

spring 或者spring-boot 中,定义了同名字的两个bean 报错。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值