springboot 正常启动,但是访问mapper.xml文件时报错 Consider defining a bean of type ‘XXX’ in your configuration.(就是mapper映射找不到mapper.xml文件)
解决:在yml文件下添加配置, mybatis.mapperLocations=classpath:mapper/*Mapper.xml
一开始以为时mapper文件没加注解@Mapper,后面加上也没用。加上配置问题解决
spring boot自动注入出现Consider defining a bean of type 'xxx' in your configuration问题
解决:启动项目的时候,报如上错误,springboot的application启动类,放在同一个目录下或者子目录下,不然扫描不到。
详情参考:https://blog.csdn.net/qq_30725371/article/details/80356156