Java web 项目启动时报错
Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name ‘testService‘ for bean class [test.service.impl.TestServiceImpl] conflicts with existing, non-compatible bean definition of same name and class [test.service.impl.TestService]
通过搜索定位到时以下代码片段造成的报错。
1.ITestService 的实现类代码: @Service("testService") public class TestServiceImpl implements ITestService { ...... } 2.在Controller中使用代码: @Autowired private ITestService testService;
代码 1 和 2 中的 testService 冲突了,修改1和2中任意的名字即可解决
解决 org.springframework.context.annotation.ConflictingBeanDefinitionException
原文:https://www.cnblogs.com/etangyushan/p/13753942.html