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
394 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
307 1
SpringBoot:Invalid bound statement (not found)的原因和解决方案
SpringBoot:Invalid bound statement (not found)的原因和解决方案
|
前端开发 Java 数据库连接
若依 mybatis报错nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘XXX‘ 错误
若依 mybatis报错nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘XXX‘ 错误
1082 1
|
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
|
XML 前端开发 Java
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)异常
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)异常
2475 0
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)异常
|
XML 数据格式
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
307 1
org.apache.ibatis.builder.BuilderException: An invalid property ‘jdbcType ‘ was found in mapping
org.apache.ibatis.builder.BuilderException: An invalid property ‘jdbcType ‘ was found in mapping
295 0
|
XML Java 数据库连接
【异常解决】解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题
【异常解决】解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题
742 0
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
384 0

推荐镜像

更多