搭建spring boot项目时启动出现的问题,先来看异常片段:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-06-04 09:32:21.462 ERROR 18900 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Field userMapper in com.drefore.demozw.admin.service.TestOneService required a bean of type 'com.drefore.demozw.mapper.UserMapper' that could not be found.

The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Autowired(required=true)

Action:

Consider defining a bean of type 'com.drefore.demozw.mapper.UserMapper' in your configuration.

提示mapper未找到无法注入

在网上搜索了一圈有说项目结构的问题,application入口类应该放在 mapper同级目录下,可是我的目录结构没问题,可能别的地方适用,在我这只好另找办法,最后在application入口类上添加该注解解决问题

@MapperScan("mapper文件夹路径")

spring boot+mybatis报错mapper无法注入的更多相关文章

  1. spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes

    spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web serv ...

  2. Spring boot 启动报错 Failed to auto-configure a DataSource

    1.Spring boot 启动报错 Failed to auto-configure a DataSource 参考资料https://blog.csdn.net/liuyinfei_java/ar ...

  3. 解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level

    解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level 学习了:https://blog.csdn. ...

  4. 【原创】大叔经验分享(67)spring boot启动报错

    spring boot 启动报错: Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback Logg ...

  5. spring boot启动报错Error starting ApplicationContext(未能配置数据源)

    主要错误:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource c ...

  6. spring boot 启动报错(spring-boot-devtools热部署后):The elements [spring.resources.cache-period] were left unbound. Update your application's configuration

    详细错误代码: *************************** APPLICATION FAILED TO START *************************** Descript ...

  7. [Java]Java 9运行Spring Boot项目报错的解决办法

    简介 为了学习和尽快掌握 Java 9 的模块化(Module System)新特性,最近安装了 JDK 9,新建了一个 Spring Boot 进行尝试, 过程中遇到了一下报错问题,写下此文谨作为个 ...

  8. Spring Boot 启动报错 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37

    使用命令 java -jar springBoot.jar  启动项目,结果报错如下: Exception at java.lang.String.substring(String.java:) at ...

  9. spring boot 打包报错

    [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.0.RELEASE:repac ...

随机推荐

  1. 没啥用,更换注册表信息使webbrower选择适合的版本

    /// <summary>            /// 修改注册表信息来兼容当前程序            ///             /// </summary>   ...

  2. Access数据库密码破解 C#

    private string GetPassword(string file) { // 未加密的文件0x42开始至0x61之前的每间隔一字节的数值 byte[] baseByte = { 0xbe, ...

  3. 洛谷——P1451 求细胞数量

    P1451 求细胞数量 题目描述 一矩形阵列由数字0到9组成,数字1到9代表细胞,细胞的定义为沿细胞数字上下左右若还是细胞数字则为同一细胞,求给定矩形阵列的细胞个数.(1<=m,n<=10 ...

  4. CodeForces 429B【dp】

    题意: 在一个n*m的矩阵中有两只虫子,一只从左上角向右下角移动,另外一只从左下角向右上角移动. 要求: 1.第一只虫子每次只能向左或者向下移动一格,另外一只只能向上或者向右移动一格. 2.两只虫子的 ...

  5. OSChinaclient源代码学习(3)--轮询机制的实现

    主要以OSChina Androidclient源代码中Notice的轮询机制进行解读. 一.基础知识 一般IM(即使通讯)的实现有两种方式:推送和轮询,推送就是server主动向client发送消息 ...

  6. Android手机中UID、PID作用及区别

    PID 指进程ID. PID是进程的身份标识,程序一旦运行,就会给应用分配一个独一无二的PID(ps:一个应用可能包含多个进程,每个进程有唯一的一个PID) 进程终止后PID会被系统收回,再次打开应用 ...

  7. C#使用SharpZipLib压缩解压文件

    #region 加压解压方法 /// <summary> /// 功能:压缩文件(暂时只压缩文件夹下一级目录中的文件,文件夹及其子级被忽略) /// </summary> // ...

  8. 【Mongodb教程 第十一课 】MongoDB 聚合

    聚合操作过程中的数据记录和计算结果返回.聚合操作分组值从多个文档,并可以执行各种操作,分组数据返回单个结果.在SQL COUNT(*)和group by 相当于MongoDB的聚集. aggregat ...

  9. Oracle 模糊查询方法

           在这个信息量剧增的时代,怎样帮助用户从海量数据中检索到想要的数据.模糊查询是不可缺少的. 那么在Oracle中模糊查询是怎样实现的呢?   一.我们能够在where子句中使用likeke ...

  10. 大话设计模式C++实现-第14章-观察者模式

    一.UML图 关键词:Subject维护一个Observer列表.Subject运行Notify()时就运行列表中的每一个Observer的Update(). 二.概念 观察者模式:定义了一种一对多的 ...