spring整合mybatis出现的bug

错误详情:Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.itheima.dao.AccountDao.inMoney

说是无效的绑定,未找到 com.itheima.dao.AccountDao.inMoney

项目中是写的没有问题的,命名空间和bean的配置的包与类的路径都没错。

applicationContext.xml

 

 AccountDao.xml

 

 问题出在maven的编译,很有可能是没有生产对应的xml文件,因为maven默认是不编译的

到target目录一看,把编译后的mapper.xml文件放在了另一个com.itheima.dao目录里

 

 正常编译后应该是这样:

 

 所以将AccountDao.xml文件移入放AccountDao.class的那个文件夹里,删掉原来的那个就行了。

 

posted @ 2022-05-29 17:13  我挺菜  阅读(48)  评论(0)    收藏  举报