我已解决)"/>
SpringBoot项目出现: Invalid bound statement (not found): com.**.mappe的可能原因(我已解决)
Invalid bound statement (not found): com..mappe**
报错:
{"timestamp": "2019-03-18 16:21:48","status": 500,"error": "Internal Server Error","message": "Invalid bound statement (not found): com.xxx.dao.UserMapper.selectByPrimaryKey","path": "/test"
}
在网上找了好多方法,总结如下:
1.文件夹名错误、粗心:
mapper.control 这个分级文件夹的 . 符号有可能是建文件时写的点只是个文件名,检查一下
我就是错在这,找了半天才发现!!!!!
2.构建没有进去,请看一下target文件夹下面这些是否存在,没有请重新构建
这里还可以看问题一的错误,这里文件夹是分级的,如果不分级说明文件夹建错了
3.配置文件写错
如果你是Mybatis的话请注意yml或者properties文件里面的
# MyBatis配置
mybatis:# 配置mapper的扫描,找到所有的mapper.xml映射文件mapperLocations: classpath*:mapper/**/*Mapper.xml
4.namespace下面的路径 一定要对应Dao接口或者Mapper接口
5.Dao 或者Mapper下面的方法名 和XML 中的id保持一致
更多推荐
SpringBoot项目出现: Invalid bound statement (not found): com.**.mappe的可能原因(我已解决)
发布评论