Invalid bound statement (not found)问题是什么

Invalid bound statement (not found)问题是什么

精选文章moguli202024-12-09 12:16:2428A+A-

1.出现:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

2.简单说,就是接口与xml要么是找不到,要么是找到了却匹配不到。

常用的检查方法如图:

.。

但问题依旧。

xml一定没有编译〈〉


如图,xml在src/main/java/*尝试在pom.xml中增加如下配置:


  1. <build>
  2. <resources>
  3. <resource>
  4. <directory>src/main/java</directory>
  5. <includes>
  6. <include>**/*.xml</include>
  7. </includes>
  8. </resource>
  9. </resources>
  10. </build>

Mapper.xml文件放在了src/main/java里面,程序执行的时候是默认去src/main/resources里面去找,你可以看下classes里面有没有这个mapper文件.

你可以查看你的编译出来的class文件,你会发现你mapper包里面的xml文件并没有编译进去.

编译进去.就正常了。

点击这里复制本文地址 以上内容由莫古技术网整理呈现,请务必在转载分享时注明本文地址!如对内容有疑问,请联系我们,谢谢!
qrcode

莫古技术网 © All Rights Reserved.  滇ICP备2024046894号-2