使用MyBatis时,有时候出现莫名奇妙的 Invalid bound statement (not found)异常,如果所有配置都检查没什么问题,有一种情况就是你只要随便在xml中进行一个空格或者任意改动,再保存就能正常运行。这种情况,主要是Maven有时候无法把配置文件打包到war包里面。解决办法。在pom.xml中标签里面添加
<resources>
即可
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
Invalid bound statement (not found)
最新推荐文章于 2024-03-06 18:50:45 发布