springboot Invalid bound statement (not found)
时间: 2023-09-29 16:03:41 浏览: 114
MyBatis绑定错误提示BindingException:Invalid bound statement (not found)的解决方法
在Springboot整合MyBatis时,出现"Invalid bound statement (not found)"的错误通常是由于mapper和对应的xml文件无法建立映射关系引起的。可以从以下几个方面进行排查和解决:
1. 确保正确引入了MyBatis和MyBatis-Plus的相关依赖。检查项目的pom.xml文件,确保已经正确引入了mybatis和mybatis-plus的maven依赖。
2. 检查application.yml(或application.properties)配置文件中mapper xml的扫描路径是否正确。确保配置文件中指定了正确的mapper xml文件所在的路径。
3. 检查mapper接口和xml文件之间的命名规范是否一致。确保mapper接口的方法名和xml文件中定义的statement的id一致。
4. 检查mapper xml文件中是否定义了正确的namespace。确保namespace和mapper接口的全限定名一致。
5. 检查mapper xml文件中是否定义了正确的statement。确保statement的id和mapper接口中对应方法的名字一致。
通过以上排查和解决方法,可以解决"Invalid bound statement (not found)"的问题,并建立正确的mapper和xml文件的映射关系。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [springboot报Invalid bound statement (not found):](https://blog.csdn.net/qq_42346678/article/details/121740718)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Springboot出现Invalid bound statement (not found)问题](https://blog.csdn.net/qq_42506719/article/details/130616715)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [MybatisPlus BaseMapper 中的方法全部 Invalid bound statement (not found Error处理)](https://download.csdn.net/download/weixin_38524871/12820792)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文