SpringBoot项目启动失败报错Annotation-specified bean name ‘xx‘ for bean class [xxx] conflicts with existing

问题描述:项目启动就会报:Annotation-specified bean name ‘xx’ for bean class [xxx] conflicts with existing, non-compatible bean definition of same name and class[xxx]

解决方法:首先查找代码中相同类名的类,发现并没有重复的,但是项目启动就会报上面的错误;

后来想起来,项目编译后会修改target中的内容,如果只删除了代码的java类,而没有删除target中的class,此时编译也会报错;删除target中多余的class类即可;

SpringBoot项目启动失败报错Annotation-specified bean name ‘xx‘ for bean class [xxx] conflicts with existing_第1张图片

你可能感兴趣的:(JavaWeb,java)