概述
今天对写的一个对外接口进行测试,报错如下:
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.xxxx.xxx.xxxxxxxxxxxxxxxxx]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name ‘PaySettleQueryServiceImpl’ for bean class [com.xxxx.xxx.trade.foreignapi.impl.PaySettleQueryServiceImpl] conflicts with existing, non-compatible bean definition of same name and class [com.xxxx.xxx.route.foreignapi.service.impl.PaySettleQueryServiceImpl]
大体意思是在不同的包下有相同的名称和类。
想起来之前这个接口写错在包route下,后来把这一系列移动到了另一个包trade下。就去检查了一下本地,又去git上查看了一下,发现也确实都移动了,为什么还会存在同名文件呢,按说不应该的。
想到应该是移动后,没有clean一下,导致确实存在两个同名文件了。然后去该模块下clean了一下,再运行,不再报这个错误。
最后
以上就是平常可乐为你收集整理的异常解决:conflicts with existing, non-compatible bean definition of same name and class的全部内容,希望文章能够帮你解决异常解决:conflicts with existing, non-compatible bean definition of same name and class所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复