问题描述
- 异常org.mybatis.spring.MyBatisSystemException:
-
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 InvestorMapper.listInvestor
Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for InvestorMapper.listInvestor
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:364) at $Proxy5.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:194) at models.Dao.findForList(Dao.java:148) at controllers.BusiTzNetvalController.listInvestor(BusiTzNetvalController.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:546) at play.mvc.ActionInvoker.invoke(ActionInvoker.java:500) at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:476) at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:471) at play.mvc.ActionInvoker.invoke(ActionInvoker.java:159) at play.server.PlayHandler$NettyInvocation.execute(PlayHandler.java:220) at play.Invoker$Invocation.run(Invoker.java:265) at play.server.PlayHandler$NettyInvocation.run(PlayHandler.java:200) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.ibatis.exceptions.PersistenceException:
Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for InvestorMapper.listInvestor
Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for InvestorMapper.listInvestor
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:354) ... 24 more
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for InvestorMapper.listInvestor
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:768)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:603)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:596)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:103)
... 30 more
解决方案
models.Dao.findForList(Dao.java:148)
查看这句
Mapped Statements collection does not contain value for InvestorMapper.listInvestor
listInvestor中没有数据
解决方案二:
InvestorMapper.listInvestor的配置文件中的namespace配置不正确,需要加上""
解决方案三:
尖括号mapper namespace= "xxx.xxx.InvestorMapper"尖括号