报错摘要
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): me.jing.module.mapper.UserMapper.getUserList
报错说明
该报错主要是 mapper/dao 层的接口找不到 mybatis 的映射配置文件 *.xml
解决方案
第一种: 根据 mapper/dao 层的接口路径, 给 mybatis 的映射配置文件 *.xml 整一个一模一样的路径
src.main.java.me.jing.module.mapper.UserMapper.java
src.main.resources.me.jing.module.mapper.UserMapper.xml
第二种: 在 application.yml 中增加一个配置:
mybatis:
mapper-locations: classpath:mapper/*.xml # 扫描所有 mapper 文件夹下的 xml 文件作为 mybatis 的映射文件