工具及背景: 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", 如下:

mybatis+spring boot, mapper 提示Could not autowire. No beans of … type found的更多相关文章

  1. mapper提示Could not autowire. No beans of … type found?

    工具及背景: IntelliJ IDEA 2016.1.3 Ultimate.spring boot, maven项目,利用mybatis 注解的方式查询mysql 在自动生成工具生成代码后,serv ...

  2. SpringBoot注入Mapper提示Could not autowire. No beans of 'xxxMapper' type found错误

    通过用Mabatis的逆向工程生成的Entity和Mapper.在Service层注入的时候一直提示Could not autowire. No beans of 'xxxMapper' type f ...

  3. IDEA - 错误提示 Could not autowire. No beans of '' type found

    工具: IntelliJ IDEA 2019.3.4 x64 Ultimate,maven项目: 现象:如下图所示,出现Could not autowire. No beans of '' type ...

  4. spring boot:配置shardingsphere(sharding jdbc)使用druid数据源(druid 1.1.23 / sharding-jdbc 4.1.1 / mybatis / spring boot 2.3.3)

    一,为什么要使用druid数据源? 1,druid的优点 Druid是阿里巴巴开发的号称为监控而生的数据库连接池 它的优点包括: 可以监控数据库访问性能 SQL执行日志 SQL防火墙 但spring ...

  5. spring boot:使用分布式事务seata(druid 1.1.23 / seata 1.3.0 / mybatis / spring boot 2.3.2)

    一,什么是seata? Seata:Simpe Extensible Autonomous Transcaction Architecture, 是阿里中间件开源的分布式事务解决方案. 前身是阿里的F ...

  6. spring boot 运行提示:Process finished with exit code 1

    spring boot 运行提示:Process finished with exit code 1 经检查发现是由于在application.properties配置文件中将某些自定义配置项移除了, ...

  7. spring boot mapper层传参数是用main的arg0(第一个参数),arg1(第二个参数)

    spring boot mapper层传参数是用main的arg0(第一个参数),arg1(第二个参数) 大于三个参数,用map传递 public interface FrontMapper{ //= ...

  8. mybatis spring boot深入

    [size=large]头一篇博文说了整合了spring boot和mybatis大家都可以对后台数据进行操作但是如何才能进行高效的操作数据库节省代码,下面来一起谈论哈mybatis的通用mapper ...

  9. Spring Boot启动提示:org.apache.catalina.LifecycleException: A child container failed during start

    一.问题回顾 最近在做一个新项目,从git上下载导入idea后,启动项目,但是报了如下错误: java.util.concurrent.ExecutionException: org.apache.c ...

随机推荐

  1. TensorFlow 1.2.0新版本完美支持Python3.6,windows在cmd中输入pip install tensorflow就能下载应用最新tensorflow

    TensorFlow 1.2.0新版本完美支持Python3.6,windows在cmd中输入pip install tensorflow就能下载应用最新tensorflow 只需在cmd中输入pip ...

  2. 75.Java异常处理机制-手动抛出异常

    package testDate; import java.io.File; import java.io.FileNotFoundException; public class TestReadFi ...

  3. pic_scrapy_python

    # _*_ coding:UTF-8 _*_ import requests,json,time,sys from contextlib import closing class get_photos ...

  4. JavaScript笔记 #06# Promise简单例子

    索引 回调版本 Promise版本1 Promise版本2 Notes 参考资料: Promise JavaScript Promise:简介 你去书店借书,按照异步的套路,剧情如下↓ 你:“老板,有 ...

  5. DBCP数据库连接池的使用

    DBCP的简单介绍: DBCP(DataBase Connection Pool)数据库连接池,是java数据库连接池的一种,由apache开发通过数据库连接池可以让程序自动管理数据库连接的释放和断开 ...

  6. PHP中array_map与array_column之间的关系分析

    array_map()与array_column()用法如下: array_map();将回调函数作用到给定数组的单元上array_column();快速实现:将二维数组转为一维数组 array_co ...

  7. 02: docker高级篇

    1.1 Docker Compose 1.Docker Compose 介绍 1. Compose是一个定义和管理多容器的工具,使用Python语言编写. 2. 使用Compose配置文件描述多个容器 ...

  8. python3 logging模块

    很多程序都有记录日志的需求,并且日志包含的信息有正常的程序访问日志还可能有错误,警告等信息输出,python的logging模块提供了标准的日志接口,可以通过它存储各种格式的日志,日志级别等级:cri ...

  9. pillow生成验证码

    1.结果 2.安装pillow cmd里进入python,pip install pillow,需要等一段时间 3.代码 from PIL import Image, ImageDraw, Image ...

  10. topcoder srm 470 div1

    problem1 link 首先预处理在已选字母的状态为$state$时是否可达. 然后就是按照题目进行dp.设$f[i]$表示已选字母集合为$i$时的结果. 每次可以根据$i$中含有的字母是奇数还是 ...