Error creating bean with name ‘**ServiceImpl‘: Unsatisfied dependency expressed through field ‘baseM
mybaits plus3 创建好环境后运行发现出现这个错误,找了一圈没有找到原因。
mybaits plus3 创建好环境后运行发现出现这个错误,找了一圈没有找到原因。
网上有人说没有加 @Mapper 和 @Service,但是后来发现加了也不对。
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bannerServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.bwzz.web.mapper.BannerMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
解决:
最后发现我在主类下配置的mapper接口扫描配置错了,这里具体怎么配置可以查看这个视频教程:【尚硅谷】2022版MyBatisPlus教程(一套玩转mybatis-plus)_哔哩哔哩_bilibili
我反复查看了几次后发现我配置的路径错了,修改后就对了。
欢迎加我微信: wanbeishijie (备注:CSDN)
一起交流学习或者合作开发
更多推荐
所有评论(0)