我是靠谱客的博主 平常可乐,这篇文章主要介绍异常解决:conflicts with existing, non-compatible bean definition of same name and class,现在分享给大家,希望可以做个参考。

今天对写的一个对外接口进行测试,报错如下:
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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(72)

评论列表共有 0 条评论

立即
投稿
返回
顶部