时间: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是在注解下按配置扫描的方式去创建对象的,那么两个重名的注解也就不成立了。