Spring项目启动报错No qualifying bean of type [xxx] is defined: expected single matching bean but found 2 [
Spring项目启动的时候,报以下异常:
No qualifying bean of type [xxx] is defined: expected single matching bean but found 2 [xxx1,xxx2]
通过调查,发现[xxx1,xxx2]中的xxx2是同事在applicationContext-xxx.xml文件中新增的一个Bean元素,而xxx1是在项目中原有的,这两个Bean元素对应的是同一个类。而在项目中引入该元素的写法,并没有进行相应的修改,还是下面.
转载
2020-11-26 14:16:00 ·
2891 阅读 ·
0 评论