SpringBoot项目出现: Invalid bound statement (not found): com.**.mappe的可能原因(我已解决)

编程入门 行业动态 更新时间:2024-10-04 15:33:23

SpringBoot项目出现: Invalid bound statement (not found): com.**.mappe的可能原因(<a href=https://www.elefans.com/category/jswz/34/1668037.html style=我已解决)"/>

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的可能原因(我已解决)

本文发布于:2024-02-28 11:05:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1769511.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我已   原因   项目   Invalid   SpringBoot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!