如图所示,报错如下
可以看到它提示说我的resource下面没有mapper/*.xml相关的文件,当时就给我整蒙了
我一查target文件夹
发现我的UserMapper在
最后才找到问题所在,在配置文件中如下两个:
# 指定 mybatis 映射文件位置 mybatis.config-locations=classpath:xxx/*.xml # locations写错成location,springboot就找MyBatis主配置文件,如果这个文件没有就会报错 mybatis.config-location=classpath:xxx/*.xml
少写一个s,疯狂找bug
标签:xml,mapper,resource,springboot,配置文件,cannot,mybatis From: https://www.cnblogs.com/lhbilibili/p/16869902.html