mybatis中的异常

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

即在mybatis中dao接口与mapper配置文件在做映射绑定的时候出现问题,简单说,就是接口与xml要么是找不到,要么是找到了却匹配不到。

截图为网络中搜索到的常见原因:

 6. 使用IDEA+Springboot,同时在pom.xml中导入mybatis和mybatis-plus也会出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)这个错误,mybatis和mybatis-plus是冲突的,需注释一个

7. 还有参数要对应,查询的时候明明有参数,结果sql里面没有写parameterType,也会报这个错误。

8. 原本写的是 mybatis: mapperLocations: classpath:mapper/**/*.xml 看到你classpath后面有个*号。赶紧加上去就可以了!? 现在改为这样 mybatis: mapperLocations: classpath*:mapper/**/*.xml

 以上是参见别人的,我的错误见下图

 

 

看这篇:https://blog.csdn.net/TD_FAlmK/article/details/90664503?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-9.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-9.nonecase

来源:https://blog.csdn.net/sundacheng1989/article/details/81630370

posted @ 2020-08-03 22:30  从来没有平凡的时刻  阅读(272)  评论(0编辑  收藏  举报