springboot整合mybatis中:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

简介: 在项目的启动过程中如果出现:以下报错信息,则可以从以下几个方面入手排查问题。org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)一般的原因是Mapper interface和xml文件的定义对应不上,需要检查包名,namespace,函数名称等能否对应上,需要比较细致的对比,这是第二次出现这种异常。我每次都是按照如下方法去逐一排查的,到最后都能解决问题。

一、背景描述


在项目的启动过程中如果出现:以下报错信息,则可以从以下几个方面入手排查问题。

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

一般的原因是Mapper interface和xml文件的定义对应不上,需要检查包名,namespace,函数名称等能否对应上,需要比较细致的对比,这是第二次出现这种异常。我每次都是按照如下方法去逐一排查的,到最后都能解决问题。

二、解决方案

按以下步骤逐一排查:

1:检查xml文件所在的package名称是否和interface对应的package名称一一对应。

2:检查xml文件的namespace是否和xml文件的package名称一一对应。

3:检查函数名称能否对应上。

4:去掉xml文件中的中文注释。

5:随意在xml文件中加一个空格或者空行然后保存。


一般来说到此就可以排除错误了,我出现的两次这5步就搞定了。


**本文首发于CSDN,为博主原创文章,如果需要转载,请注明出处,谢谢!**


完结!

相关文章
|
XML Java 数据库连接
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):XXXXX
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):XXXXX
240 1
|
XML Java 数据库连接
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.example.forum.d
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.example.forum.d
185 1
SpringBoot:Invalid bound statement (not found)的原因和解决方案
SpringBoot:Invalid bound statement (not found)的原因和解决方案
|
消息中间件 Java Kafka
Spring Boot与Apache Kafka Streams的集成
Spring Boot与Apache Kafka Streams的集成
|
Java 数据库连接 mybatis
Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid
Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid
|
存储 NoSQL Java
实现Spring Boot与Apache Cassandra的数据存储整合
实现Spring Boot与Apache Cassandra的数据存储整合
|
消息中间件 Java Kafka
Spring Boot与Apache Kafka集成的深度指南
Spring Boot与Apache Kafka集成的深度指南
|
Java Apache Spring
整合Spring Boot和Apache Solr进行全文搜索
整合Spring Boot和Apache Solr进行全文搜索
|
消息中间件 Java Kafka
Spring Boot与Apache Kafka集成的深度指南
Spring Boot与Apache Kafka集成的深度指南
|
Java Apache Spring
整合Spring Boot和Apache Solr进行全文搜索
整合Spring Boot和Apache Solr进行全文搜索

热门文章

最新文章

推荐镜像

更多