我是靠谱客的博主 平常可乐,最近开发中收集的这篇文章主要介绍异常解决: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 with existing, non-compatible bean definition of same name and class所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部