其他分享
首页 > 其他分享> > IDEA异常解决: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

IDEA异常解决: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

作者:互联网

最近在做一个博客项目用Springboot框架开发,在配置好Mapper接口后启动项目,IDEA报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)异常。
网上找了许多解决方法,我觉得这个作者写的不错:https://cloud.tencent.com/developer/article/1501856

下面给出我的排查步骤:
1.首先我检查了mapper接口与mapper.xml文件的文件名是否一致,以及目录层级是否一致。
2.检查mapper.xml中的namespace路径是否正确,以及id、resultType是否对应等。
3.检查target中,mapper.xml文件是否被发布
4.重启idea
5.我发现上述步骤都没有效果,项目依然报错,我把mapper.xml删除,然后启动项目,依旧报org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)异常。
之后,我才发现,我的mapper.xml文件不知道怎得,我居然没写.xml后缀!!!!!!
6.写上.xml后缀,重启项目,成功!!!!!!!!!!!!

我的xml是放在resources下的
image

标签:xml,mapper,binding,IDEA,Invalid,ibatis,statement
来源: https://www.cnblogs.com/hkz329/p/16029126.html