idea报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.money.*

因为最近刚使用idea,所以就出了很多不明问题,以下解决也许是不明智的,但还是记录一下,防止以后再出现这种问题又找半天。

使用Idea搭建Myabatis时报以下错误:

idea报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.money.*

但检查mybatis相关配置文件,比如namespace、statement id这些信息都是正确的:

idea报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.money.*

idea报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.money.*

原因:后来发现原来是resources的问题,我用的idea resources目录下的包名都是文件夹形式的,所以导致程序无法通过package去获取该文件,只要把resources下的文件夹形式的路径改为packagge形式就OK了

出问题的建包方式:

idea报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.money.*

解决后的建包方式:

将resources目录更改为正确的类型:

idea报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.money.*


按正确的方式建包名

idea报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.money.*

最后问题解决。