异常解决: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了一下,再运行,不再报这个错误。
在这里插入图片描述

  • 14
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值