搭建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. P1359 租用游艇 洛谷

    https://www.luogu.org/problem/show?pid=1359 题目描述 长江游艇俱乐部在长江上设置了n 个游艇出租站1,2,…,n.游客可在这些游艇出租站租用游艇,并在下游的 ...

  2. 仿苹果app下载动画-煎饼

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  3. 从壹开始前后端分离【重要】║最全的部署方案 & 最丰富的错误分析

    缘起 哈喽大家好!今天是周一了,这几天趁着午休的时间又读了一本书<偷影子的人>,可以看看

  4. dnsmasq possible DNS-rebind attack detected错误

    最近在做openwrt的平台,dns使用的是dnsmasq,但是通过板子上网,将PC的dns设置成板子的时候,发现百度等都可以,但是公司邮箱打不开.公司邮箱的域名 xx-xx-notes.xxx.co ...

  5. Reload file in vim

    68down voteaccepted Give this a try: :e From :h :e: Edit the current file. This is useful to re-edit ...

  6. 再说javascript 的__proto__ 和prototype 属性

    过了一段时间,没写 原生的 javascript 的了,感觉天天在用框架写代码,框架写代码完全限定死了你所需要思考的东西,只是在处理一些业务逻辑,真正的代码 都感觉不会写了. 突然发现,框架用的不熟悉 ...

  7. Prime Distance(二次筛素数)

    Description The branch of mathematics called number theory is about properties of numbers. One of th ...

  8. #include<> 和 #include""的区别

    #include< file >编译程序会先到标准函数库中找文件 #include”file” 编译程序会先从当前目录中找文件 参考原文 转: 在C程序中包含文件有以下两种方法: (1)用 ...

  9. C#/AutoCAD 2018/ObjectArx/二次开发添加圆对象的的例子(五)

    C#/AutoCAD 2018/ObjectArx/二次开发添加圆对象的的例子(五) 1.创建一个图形对象的步骤如下见上一篇博客(三)2.添加删除实体的工具函数见上一篇博客(四) 3.添加圆的例子(完 ...

  10. enterText与typeText

    转自:http://www.cnblogs.com/hyddd/p/4126979.html 问题场景: Robotium.enterText输入数据后,点击"发送"按钮,多数情况 ...