Spring异常:Annotation-specified bean name.. for bean class ...

时间:2020-04-28

异常:

Annotation-specified bean name ‘DistrictServiceImpl’ for bean class [com.qiu.service.impl.DoctorDetailServiceImpl] conflicts with existing, non-compatible bean definition of same name and class [com.qiu.service.impl.DistrictServiceImpl]

情景:

项目新增一个业务逻辑的Impl类之后,项目就报错了。但出错比较容易找。

原因:

上网一搜,大概是Spring重命名问题。

然后对照我的项目中的注解,果然是新增的DistrictServiceImpl类@Service重名了。

由于Spring是在注解下按配置扫描的方式去创建对象的,那么两个重名的注解也就不成立了。


我的微信号: xiang20200106 ,欢迎大家找我聊天

— 【 THE END 】—

在这里插入图片描述

本公众号已经整理一套包含前端和后端的全套电子书教程,限时免费赠送,请在公众号里回复「电子书」获取!
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值