出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误的筛查
2022-02-20 16:51
1321 查看
这个错误新手经常犯(说的就是我),也就是 dao 接口和 mapper 文件没有绑定映射上。问题很多,我收集了网上大部分遇到的解决方法。照着下面排查就行:
检查各种路径和名称,返回值是否对上了
-
xml 文件中
<mapper namespace ="xxx">
地址是否和你所在 Dao接口路径完全一致,名称是否相同- xml 文件中的方法名比如
<select id = "xxx">
是否和你所在 Dao 接口中的方法完全一致,名称是否相同 - xml 文件中的方法返回值是否和 Dao 接口中的完全相同,比如 xml 中返回 string 而 Dao 接口中需要返回对象,这样也会报错,需要重新改成完全相同。
配置文件问题,是否扫描到 xml 文件
-
配置路径一定要写好如
mybatis.mapper-locations=classpath:mybatis/mapper/*.xml
确保能扫描到你的 xml 文件。还有配置好映射所在的包名比如type-aliases-package:xxx
这个路径是否正确。- 还有一个我遇到的问题,我的 xml 文件后缀没有加 .xml ,但是我的配置路径上是扫描的 *.xml 。最后也是绑定失败,这个时候重新改过来就好了。
相关文章推荐
- idea开发出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
- mybatis maven打包出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
- IDEA的maven项目出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误解决方法
- ssm整合出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
- 解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
- 当mybatis整合spring后出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- 当出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)时怎么解决
- springboot配置时出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis绑定错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- 关于mybatis “org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)” 错误的问题
- 出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)的解决方法
- mybatis多数据源错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误记录
- 单元测试出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybaits错误记录:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误解决方法
- 关于mybatis “org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)” 错误的问题。
- mybatis绑定错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis绑定错误org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis整合springmvc时的错误org.apache.ibatis.binding.BindingException: Invalid bound statement (not found