【BUG日记】Error creating bean with name ‘userServiceImpl‘: Unsatisfied dependency expressed through...
【日期】: 2020/11/20
【问题】: 启动项目的时候,报错Error creating bean with name ‘userServiceImpl’: Unsatisfied dependency expressed through field ‘baseMapper’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.nanfangzhe.anpaipublic.mapper.UserMapper’ available: expected at least 1 bean which qualifies as autowire candidate.
【原因】: 缺少@Mapper层的注解
【如何发现】: 一个个排查检查。
【如何修复】: 在mapper层添加注解 @Mapper
在*.properties文件里还需要添加*.xml文件的扫描。
【总结】: 《大意失荆州》