在学习Spring-boot-mybatis时,报错A component required a bean of type 'com.sirifeng.testmybatis.mapper.BookMapper' that could not be found.

后来发现是在启动器上没有添加注解

@MapperScan("com.sirifeng.testmybatis.mapper")

如有这个错误的可以看一下是不是因为这个原因。

Java报错: A component required a bean of type 'com.sirifeng.testmybatis.mapper.BookMapper' that could not be found.的更多相关文章

  1. Sping Cloud项目启动报A component required a bean of type 'com.tianyan.bbc.dao.SecurityUserBaseMapper' that could not be found.

    项目构建正常,启动和Debug报以下错误: Error starting ApplicationContext. To display the conditions report re-run you ...

  2. STS中不同包但相同类名引起的问题:A component required a bean of type 'javax.activation.DataSource' that could not be found

    1. 问题输出: APPLICATION FAILED TO START*************************** Description: A component required a ...

  3. 【spring boot】mybatis启动报错:Consider defining a bean of type 'com.newhope.interview.dao.UserMapper' in your configuration. 【Mapper类不能被找到】@Mapper 和@MapperScan注解的区别

    启动报错: 2018-05-16 17:22:58.161 ERROR 4080 --- Disconnected from the target VM, address: '127.0.0.1:50 ...

  4. springboot 工程启动报错之Consider defining a bean of type ‘XXX’ in your configuration.

    一.前言: 使用springboot自动注入的方式搭建好了工程,结果启动的时候报错了!!!,错误如下图: Description: Field userEntityMapper in com.xxx. ...

  5. SpringBoot中service注入失败(A component required a bean of type 'XXService' that could not found)

    先写了JUnit,发现启动不了,注释掉有问题的service也不可以.可能是因为spring开始时会加载所有service吧. 按照网友们的说法,一般需要检查: 1.入口类有没有写MapperScan ...

  6. SpringBoot扫描不到类,注入失败A component required a bean of type 'XXService' that could...

    SpringBoot项目的Bean装配默认规则是根据Application类所在的包位置从上往下扫描! “Application类”是指SpringBoot项目入口类.这个类的位置很关键: 如果App ...

  7. Field tTypeMapper in com.atguigu.project.service.imp.projectInfoServiceImpl required a bean of type 'com.atguigu.project.mapper.TTypeMapper' that could not be found.

    解决:MapperScan

  8. springboot 启动报错Consider defining a bean of type 'com.example.springbootdruid.mapper.UserMapper' in your configurati

    一.问题 springboot项目启动时报错: Field userMapper in com.example.springbootdruid.service.impl.UserServiceImpl ...

  9. a commponent required a bean of type XXXXXX that could not be found-2022新项目

    一.问题由来 目前刚入职一家新公司不久,公司的新项目采用DDD驱动领域设计来进行开发,架构这一块使用的是阿里巴巴开源的最新框架COLA4.0的架构. 主要是这个框架里面的分层设计.主要分为四层:ada ...

随机推荐

  1. 全面解读 AWS Private 5G 的革新理念

    目录 目录 目录 前言 近几年 AWS 在 5G ICT 领域的部署 AWS 与 Verizon 合作推出的 Private MEC 解决方案 AWS 与 Vodafone Business 合作推出 ...

  2. 路由的query参数(传参)

    路由组件不会在组件里面放自己组件标签. 案例使用嵌套组件的,但是在Message组件下新增了组件Detail.vue index.html //引入bootstrap.css <link rel ...

  3. 完全激活win server 2012的方法(亲测可行!)

    1.从微软官网下载评估版. 2.运行->CMD(最好以管理员身份运行)->输入"DISM /online /Get-CurrentEdition"(最好直接复制粘贴,然 ...

  4. LGP2155题解

    lg最优解来写题解啦( 题目大意: 多测: \[\sum_{i=1}^{n!}[\gcd(i,m!)=1] \] 根据 \(\gcd\) 的结论,我们可以得到答案其实是: \[\frac {n!} { ...

  5. 从此 Typora 代码块有了颜色

    起因 平时喜欢用typora记笔记,但是typora默认代码块没有指定语言,没有高亮看着很不舒服,所以用Autohotkey花了半天写了个脚本,按自己的快捷键就可以自动生成代码块并添加语言,这样就方便 ...

  6. 从MyIE2平滑升级到Maxthon的完美方案

    经过几个Beta版本的测试MyIE2改名为Maxthon的新版浏览器终于发布了正式版本.喜欢MyIE2的朋友们也可以放心的将你的MyIE2升级为Maxthon了.以下是MyIE2平滑过渡到Mathxo ...

  7. Redis 新特性:多线程模型解读

    Redis 官方在 2020 年 5 月正式推出 6.0 版本,提供很多振奋人心的新特性,所以备受关注. 主要特性如下: 多线程处理网络 IO: 客户端缓存: 细粒度权限控制(ACL): RESP3  ...

  8. Circle Linux镜像在阿里云镜像站首发上线

    镜像下载.域名解析.时间同步请点击阿里云开源镜像站 Circle Linux简介 Circle Linux 社区是一个开源.共创的 Linux 社区,将通过完全开放.包容的社区形式与全球开发者共同构建 ...

  9. Python的安装与开发环境的选用

    2021快要结束了,这一年我依旧深耕于python的广阔土壤,将重点放在机器人和传感器的角度.也收获了一大批正在学习和期望学习python的朋友. 正在学习的暂且不言,这篇主要是写给期望学习的朋友,同 ...

  10. Kruscal algorithm

    #include <iostream> #include <algorithm> using namespace std; #define MAX 5 #define INF ...