Mybatis在idea中错误:Invalid bound statement (not found)

用IDEA 开发mybatis时候出现的错误。测试mapper自动代理的时候一直出错,在eclipse中可以正常运行,而同样的代码在idea中却无法成功。

IDEA的maven项目中,默认源代码目录下的xml等资源文件并不会在编译的时候一块打包进classes文件夹,而是直接舍弃掉

方法1:将xml或properties等配置文件放到resource下,并修改获取配置文件的代码,比如注册mapper.xml的位置等;

Mybatis在idea中错误:Invalid bound statement (not found)

Mybatis在idea中错误:Invalid bound statement (not found)

方法2

在maven中添加过滤:

Mybatis在idea中错误:Invalid bound statement (not found)

Invalid bound statement (not found)