spring boot org.springframework.context.annotation.ConflictingBeanDefinitionException

org.springframework.context.annotation.ConflictingBeanDefinitionException

分析接解决方法

annotation.ConflictingBeanDefinitionException说明是系统内的注解错误,在继续往下看bean definition of same name 定义了相同的bean这就看你系统内的service及component里面写的名称是不是有重复的?如果是修改点重复的就可以了。

org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean ****name ‘DeExecutor’ for bean class [com.DefRuleExecutor] conflicts with existing, non-compatible bean definition of same name and class

错误信息

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com..Application]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean **name 'DeExecutor' for bean class [com.Executor] conflicts with existing, non-compatible bean definition of same name and class** [com.r.Executor]
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:184)
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:316)
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:271)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:91)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:692)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:530)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:386)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1242)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1230)
	at com.main(Application.java:11)
Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'DefRuleExecutor' for bean class [com..Executor] conflicts with existing, non-compatible bean definition of same name and class [com.Executor]
	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)
	... 13 common frames omitted
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException报错是由于存在重复的bean定义***com.compass.core.hanlder.BaseExceptionHandle]不兼容。这个错误通常发生在Spring Boot项目启动时,当存在相同名称但不兼容的bean定义时会触发该异常。 为解决这个问题,可以考虑以下方法: 1.检查项目中的bean定义,确保没有重复的名称或类。可以使用IDE的搜索功能来查找所有包含问题bean名称的地方。 2.如果确实存在相同名称但不兼容的bean定义,可以通过更改bean名称或类名来解决冲突。 3.另外,你也可以使用@ComponentScan注解的excludeFilters属性来排除掉不需要的bean定义,或者使用includeFilters属性来只包含需要的bean定义。这样可以更精确地控制项目中的bean扫描。 综上所述,Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException报错是由于存在重复的bean定义导致的。解决这个问题的方法包括检查重复的bean定义并进行修正,以及使用@ComponentScan注解的excludeFilters和includeFilters属性进行精确控制。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException Annotation 报错...](https://blog.csdn.net/weixin_42717648/article/details/128582047)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值