慕田峪2884171
2017-10-15 23:27
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for Message.getListDao
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for Message.getListDao
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:122)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:113)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108)
at com.imooc.dao.ListDao.getListDao(ListDao.java:45)
at com.imooc.service.ListService.getListDao(ListService.java:18)
at com.imooc.service.ListService.main(ListService.java:22)
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for Message.getListDao
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:832)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:665)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:658)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:119)
... 5 more
确认xml文件没有写错,那就是位置的问题了,这是老外的答案?
映射语句集合不包含值,原因可能是
1.mybatis的映射文件的命令空间与接口的全限定名不一致;
2有可能mybatis的映射文件名字与接口的类名字不一致;
3.还有一种情况就是接口声明的方法在映射文件里面没有。
通过自动回复机器人学Mybatis---基础版
107412 学习 · 786 问题
相似问题