mybatis+spring boot, mapper 提示Could not autowire. No beans of … type found
来源:互联网 发布:工商管理就业知乎 编辑:程序博客网 时间:2024/05/22 22:18
工具及背景: IntelliJ IDEA 2016.1.3 Ultimate。spring boot, maven项目,利用mybatis 注解的方式查询mysql。
业务逻辑关系:controller --> Service接口 ----> serverImpl --->Dao -->DaoImpl ---> mapper -->db
问题:mapper提示Could not autowire. No beans of … type found?如图:
其中ProductDaoMyBatisMapper是个接口,用于查询mysql,结构如下图:
解决办法:将第一张图中的ProductDaoMyBatis类序列化,即实现Serializable 接口即可,如下图:
补:pom.xml
<!--mybatis-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.1.1</version>
</dependency>
方法二: 还有一种方式,修改idea配置,将spring 的severity的值设置为"warning", 如下:
阅读全文
0 0
- mybatis+spring boot, mapper 提示Could not autowire. No beans of … type found
- idea中mybatis+spring boot, mapper 提示Could not autowire. No beans of … type found解决办法
- mybatis+spring boot, @Autowired 提示Could not autowire. No beans of … type found
- mapper提示Could not autowire. No beans of … type found?
- Could not autowire. No beans of … type found
- 【问题】Could not autowire. No beans of … type found
- could not autowire.No beans of 'FunctionService' type found.
- Could not autowire. No beans of 'xxxx' type found
- Could not autowire. No beans of 'xxxMapper' type found.
- Could not autowire. No beans of 'UserMapper' type found.
- Idea的spring工程里,经常会遇到Could not autowire. No beans of 'xxxx' type found的错误提示
- idea 出现Could not autowire. No beans of 'xxxxMapper' type found. 安装 Mybatis Plugin 插件
- IntelliJ Idea取消Could not autowire. No beans of 'xxxx' type found的错误提示
- IntelliJ Idea取消Could not autowire. No beans of 'xxxx' type found的错误提示
- IntelliJ Idea取消Could not autowire. No beans of 'xxxx' type found的错误提示
- IntelliJ Idea取消Could not autowire. No beans of 'xxxx' type found的错误提示
- IntelliJ Idea取消Could not autowire. No beans of 'xxxx' type found的错误提示
- IntelliJ Idea取消Could not autowire. No beans of 'xxxx' type found的错误提示
- so库相关错误
- webpack和babel结合
- CSS background-position 属性
- 对比java和python
- 简述CDN原理
- mybatis+spring boot, mapper 提示Could not autowire. No beans of … type found
- MySql 申明变量以及赋值
- RE:JAVA学习-了解内存管理+继承的意义
- FPGA功能仿真,门级仿真,后仿真的区别
- 静态代理
- Oracle执行出现正在提交的原因及解决办法
- Unity3D 脚本实现动画效果
- Apache Flink:详细入门
- LeetCode 560. Subarray Sum Equals K