spring boot+mybatis报错mapper无法注入
搭建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无法注入的更多相关文章
- 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 ...
- Spring boot 启动报错 Failed to auto-configure a DataSource
1.Spring boot 启动报错 Failed to auto-configure a DataSource 参考资料https://blog.csdn.net/liuyinfei_java/ar ...
- 解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level
解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level 学习了:https://blog.csdn. ...
- 【原创】大叔经验分享(67)spring boot启动报错
spring boot 启动报错: Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback Logg ...
- spring boot启动报错Error starting ApplicationContext(未能配置数据源)
主要错误:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource c ...
- spring boot 启动报错(spring-boot-devtools热部署后):The elements [spring.resources.cache-period] were left unbound. Update your application's configuration
详细错误代码: *************************** APPLICATION FAILED TO START *************************** Descript ...
- [Java]Java 9运行Spring Boot项目报错的解决办法
简介 为了学习和尽快掌握 Java 9 的模块化(Module System)新特性,最近安装了 JDK 9,新建了一个 Spring Boot 进行尝试, 过程中遇到了一下报错问题,写下此文谨作为个 ...
- 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 ...
- spring boot 打包报错
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.0.RELEASE:repac ...
随机推荐
- POJ 1328 Radar Installation【贪心 区间问题】
题目链接: http://poj.org/problem?id=1328 题意: 在x轴上有若干雷达,可以覆盖距离d以内的岛屿. 给定岛屿坐标,问至少需要多少个雷达才能将岛屿全部包含. 分析: 对于每 ...
- easyUI排序问题
使用easyUI时,需要在点击页面的某一列进行desc或asc排序,那么在jsp中可以把该列js的sortable 设置true. 加在某字段上时,该字段点击时页面会出现一小三角图案 ,此时easyU ...
- 删除,“windows setup 启用EMS”
方案1[笔者推荐]:进入Windows后按Windows+R输入msconfig回车进入系统配置,切换到引导,点击你要删除的选项然后点击删除就行[1].
- Shiro note
我们需要实现Realms的Authentication 和 Authorization.其中 Authentication 是用来验证用户身份,Authorization 是授权访问控制,用于对用户进 ...
- 2003-07-16T01:24:32Z这是什么时间格式
这是标准的XML Schema的"日期型数据格式”. T是代表后面跟着“时间”.Z代表0时区,或者叫UTC统一时间. 世界的每个地区都有自己的本地时间,在Internet及无线电通信时,时间 ...
- 选带傅里叶变换(zoom-fft)
选带傅里叶变换的原理大家能够看书.大致的步骤为 移频 (将选带的中心频率移动到零频) 数字低通滤波器 (防止频率混叠) 又一次採样 (将採样的数据再次间隔採样,间隔的数据取决于分析的带宽,就是放大 ...
- 大型网站技术架构(四)--核心架构要素 开启mac上印象笔记的代码块 大型网站技术架构(三)--架构模式 JDK8 stream toMap() java.lang.IllegalStateException: Duplicate key异常解决(key重复)
大型网站技术架构(四)--核心架构要素 作者:13GitHub:https://github.com/ZHENFENG13版权声明:本文为原创文章,未经允许不得转载.此篇已收录至<大型网站技 ...
- exadata(ilom) 练习
Oracle(R) Integrated Lights Out Manager Version 3.0.16.10 r65138 Copyright (c) 2011, Oracle and/or i ...
- hdu1576 mod 运算的逆元
Problem Description 要求(A/B)%9973,但因为A非常大,我们仅仅给出n(n=A%9973)(我们给定的A必能被B整除.且gcd(B,9973) = 1). Input 数 ...
- 竞赛中经常使用的C++写法
首先是构造函数,重载 #include <iostream> #include <cstdio> #include <cstring> #include <s ...