java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for
异常的出现
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.xxxx.order.dao.task.OrderMapper.findAddressOrderBlackList
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.xxxx.order.dao.task.OrderMapper.findAddressOrderBlackList
原因
MappedStatement集合里面不包含这个方法,MyBatis会根据xml文件生成MappedStatement放到Configuretion中,如果找不到,有可能是对应的xml找不到,或者xml中没有id为findAddressOrderBlackList语句。
探索
sch:在很久之前页遇到过同样的问题,原因是xml文件的namespace不对,也导致从MappedStatement的集合中查询不到。最近在阅读MyBatis源码,所以一看就知道是什么原因导致的了。
上次的链接:
http://www.jianshu.com/p/322a2c897352