栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)原因总结

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)原因总结

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found),即在mybatis中mapper接口与mapper配置文件在做映射绑定的时候出现问题。简单得说就是接口与xml找不到或者是不匹配。

1、检查xml文件所在package名称是否和Mapper interface所在包名匹配

2、UserMapper的方法在UserMapper.xml中没有,然后执行UserMapper中的方法报错

3、UserMapper的方法返回值是List,而select元素没有正确配置ResultMap,或者只配置ResultType

4、如果以上没有问题,修改xml文件,例如删除一个空行

5、查看mapper的xml配置路径是否正确

mybatis:

     #配置mapper xml文件所在的路径

     mapper-locations: classpath*:mybatis/mapper/*.xml

     #配置映射类所在的包名

     type-aliases-package: com.test.entity
 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/820523.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号