java中Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value...错误
### Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.mybatis.dao.TbRoleDao.getRolesById
### The error may exist in com/mybatis/dao/TbUserMapper.xml
### The error may involve com.mybatis.dao.TbUserDao.getAllTbUser
### The error occurred while handling results
2019-08-29 16:25:10,074 DEBUG [org.apache.ibatis.transaction.jdbc.JdbcTransaction] - Closing JDBC Connection [oracle.jdbc.driver.T4CConnection@6acc9aa3]
### SQL: select * from TB_USER
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.mybatis.dao.TbRoleDao.getRolesById
2019-08-29 16:25:10,074 DEBUG [org.apache.ibatis.datasource.pooled.PooledDataSource] - Returned connection 1791793827 to pool.
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.binding.MapperMethod.executeForMany(MapperMethod.java:122)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:64)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
at com.sun.proxy.$Proxy0.getAllTbUser(Unknown Source)
at com.mybatis.test.Test07.main(Test07.java:31)
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.mybatis.dao.TbRoleDao.getRolesById
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:818)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:651)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:644)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getNestedQueryMappingValue(DefaultResultSetHandler.java:633)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getPropertyMappingValue(DefaultResultSetHandler.java:404)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.applyPropertyMappings(DefaultResultSetHandler.java:384)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.getRowValue(DefaultResultSetHandler.java:346)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValuesForSimpleResultMap(DefaultResultSetHandler.java:298)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValues(DefaultResultSetHandler.java:273)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSet(DefaultResultSetHandler.java:246)
at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:160)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:78)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:303)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:154)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:102)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:82)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:120)
... 6 more
Process finished with exit code 1
这个是因为不认识映射文件 你在配置文件中没有添加相关联的映射文件 添加相关的映射文件就好了