org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean

本文探讨了Spring框架中Bean命名冲突的原因及解决方法。当两个Bean使用相同的名称注册时会出现此问题,文章提供了应对策略。

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

当遇到这个错误的时候,可能是因为 spring注解的时候两个bean的注解名相同或冲突。如果有其他的问题,可发表评论一同讨论,谢谢~

ERROR 2025-07-25 13:51:42.114 172.18.18.95 org.springframework.boot.SpringApplication - Application startup failed org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.viewhigh.vadp.framework.web.Application]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'dynDesCore_ReceiptPoolBOImpl_bo' for bean class [com.viewhigh.oes.dyndes.dyndescore.bo.impl.ReceiptPoolBOImpl] conflicts with existing, non-compatible bean definition of same name and class [com.viewhigh.oes.custom.dyncustom.bo.impl.ReceiptPoolBOImpl] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:183) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:308) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:272) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:92) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at org.springframe
最新发布
07-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值