Springboot整合mybaits报mapper注入失败@org.springframework.beans.factory.annotation.Autowired(required=true)
最新推荐文章于 2022-11-26 18:40:53 发布
Amant_meng 于 2019-11-21 14:37:51 发布
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
Springboot整合mybaits报mapper注入失败@org.springframework.beans.factory.annotation.Autowired(required=true)
报错信息如下:
Field studentMapper in com.ccut.ebusiness.module.school.service.StudentService required a bean of type ‘com.ccut.ebusiness.module.school.mapper.StudentMapper’ that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
解决办法:
首先检查代码有没有问题,看mapper有没有@Mapper 和@Repository这两个注解,
再看pom文件里面导入mybaits依赖没有
<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.0.1</version> </dependency> 12345
相关知识
@Autowired(required=false)注入注意的问题
@RequestParam(required = true)的误区
植物健康系统
基于java jsp ssm vue网上鲜花店网站设计实现vue
基于Springboot的植物管理系统
基于Python+django的花卉商城系统花店系统(源码+lw+部署文档+讲解等)
基于springboot玉米病虫害远程咨询系统的设计与实现
SpringBoot 统一时区的方案
基于SpringBoot的网上花卉鲜花销售购物系统+Vue[毕业设计]
编程实践精华总结集锦系列1: SpringBoot/Maven/IDEA/Java/Kotlin/Redis等等
网址: Springboot整合mybaits报mapper注入失败@org.springframework.beans.factory.annotation.Autowired(required=true) https://m.huajiangbk.com/newsview849427.html