【mybatis】org.apache.ibatis.exceptions.PersistenceException:
2020-07-18 05:24
871 查看
[code]org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.itheima.mapper.CustomerMapper.findCustomerById ### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.itheima.mapper.CustomerMapper.findCustomerById at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77) at com.itheima.test.MybatisTest.findCustomerByIdTest(MybatisTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209) Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.itheima.mapper.CustomerMapper.findCustomerById at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:875) at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:708) at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:701) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ... 26 more
报此错,一般是映射文件漏了包名或者写错包名
相关文章推荐
- 学习mybatis框架中遇到org.apache.ibatis.exceptions.PersistenceException: 问题解决
- MyBatis-Exception:org.apache.ibatis.exceptions.PersistenceException
- Mybatis报错: org.apache.ibatis.exceptions.PersistenceException解决办法
- Mybatis报错: org.apache.ibatis.exceptions.PersistenceException解决办法
- 关于org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions异常
- MyBatis框架中遇到org.apache.ibatis.exceptions.PersistenceException: 问题解决了
- Mybatis错误(一)Exception in thread &quo 4000 t;main" org.apache.ibatis.exceptions.PersistenceException:
- Mybatis错误(一)org.apache.ibatis.exceptions.PersistenceException
- 学习mybatis框架中遇到org.apache.ibatis.exceptions.PersistenceException: 问题该怎么解决
- 在学习Mybatis时遇见的问题 org.apache.ibatis.exceptions.PersistenceException:
- mybatis中的一个异常:org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to
- 解决mybatis遇到异常org.apache.ibatis.exceptions.PersistenceException
- MyBatis报错:org.apache.ibatis.exceptions.PersistenceException 的解决方案
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.Persiste
- mybatis框架org.apache.ibatis.exceptions.PersistenceException:
- [mybatis-报错]org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession.
- 学习mybatis框架中遇到org.apache.ibatis.exceptions.PersistenceException: 问题该怎么解决
- FAQ(39):org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.
- 【mybatis】【org.apache.ibatis.exceptions.PersistenceException】由${}引起的异常
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.Persiste