问题:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.banksteel.erp.purchase.dao.impl.PurchaseYearconstactItemDaoImpl.insert
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.banksteel.erp.purchase.dao.impl.PurchaseYearconstactItemDaoImpl.insert
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)
at com.sun.proxy.$Proxy12.insert(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:237)
at cn.mysteel.data.ibatis.impl.AbstractIBatisDaoImpl.insert(AbstractIBatisDaoImpl.java:40)
at com.banksteel.erp.purchase.service.impl.PurchaseYearconstactItemServiceImpl.createPurchaseYearconstactItem(PurchaseYearconstactItemServiceImpl.java:34)
at com.banksteel.erp.purchase.PurchaseYearconstactItemServiceTest.testInsert(PurchaseYearconstactItemServiceTest.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.banksteel.erp.purchase.dao.impl.PurchaseYearconstactItemDaoImpl.insert
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.banksteel.erp.purchase.dao.impl.PurchaseYearconstactItemDaoImpl.insert
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:150)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:137)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:355)
... 33 more
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.banksteel.erp.purchase.dao.impl.PurchaseYearconstactItemDaoImpl.insert
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:775)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:615)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:608)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147)
... 39 more

解决:

解决:没有扫描执行到mapper文件
spring没有找到mapper文件:

spring:application.xml文件中的mapperLocations地址不对,修改正确
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="configLocation" value="classpath:mybatis/mybatis-config.xml" />
<property name="mapperLocations" value="classpath*:mybatis/mapper/**/*_mapper.xml" />
<property name="dataSource" ref="dataSource" />
</bean>

【原创】Mapped Statements collection does not contain value for DaoImpl.method的更多相关文章

  1. Mapped Statements collection does not contain value fo

    Mapped Statements collection does not contain value for后面是什么类什么方法之类的: 错误原因有几种: 1.mapper.xml中没有加入name ...

  2. mybatis报错Mapped Statements collection does not contain value for com.inter.IOper

    首页 > 精品文库 > mybatis报错Mapped Statements collection does not contain value for com.inter.IOper m ...

  3. Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for …

    编译通过并且运行web成功后,访问的页面不需要连接数据库,不牵扯到反射调用实体类就不会报错, 报错内容如下: [WARNING] org.springframework.web.util.Nested ...

  4. Spring+Mybatis整合报错Mapped Statements collection does not contain value原因之一

    报错如下: ### Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements coll ...

  5. Mapped Statements collection does not contain value for ResearcherMapper.方法名

    搞了半天, 原来是映射文件没加, 新手常遇到的问题. Mapped Statements collection does not contain value for后面是什么类什么方法之类的: 错误原 ...

  6. Mapped Statements collection does not contain value for TaskMapper.selectByPrimaryKey

    Mapped Statements collection does not contain value for后面是什么类什么方法之类的: 错误原因有几种: 1.mapper.xml中没有加入name ...

  7. mybatis mapper.xml 写关联查询 运用 resultmap 结果集中 用 association 关联其他表 并且 用 association 的 select 查询值 报错 java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for mybatis.map

    用mybaits 写一个关联查询 查询商品表关联商品规格表,并查询规格表中的数量.价格等,为了sql重用性,利用 association 节点 查询 结果并赋值报错 商品表的mapper文件为Gooo ...

  8. 错误: Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for studentDao.insert

    详细错误信息: org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: java. ...

  9. SpringBoot报错:Failed to load ApplicationContext(Mapped Statements collection already contains value)

    错误提示: Caused by: java.lang.IllegalArgumentException: Mapped Statements collection already contains v ...

随机推荐

  1. Java设计模式-模板方法模式(Template Method)

    解释一下模板方法模式,就是指:一个抽象类中,有一个主方法,再定义1...n个方法,可以是抽象的,也可以是实际的方法,定义一个类,继承该抽象类,重写抽象方法,通过调用抽象类,实现对子类的调用,先看个关系 ...

  2. ThinkPHP多表联合查询的常用方法

    1.原生查询示例: $Model = new Model(); $sql = 'select a.id,a.title,b.content from think_test1 as a, think_t ...

  3. list 内部方法

    代码 #list内部方法 l=['a','9','c','a','3','7'] print(dir(l)) l.append('v') print(l)#append(self, p_object) ...

  4. Windows下一些配置信息

    VC.VS和.NetFramework版本对应关系 VC6.0对应VS 6.0 VC7.0对应VS 2002 VC7.1对应VS 2003 .Net Framework1.0/1.1 VC8.0对应V ...

  5. BZOJ-1880 Elaxia的路线 SPFA+枚举

    1880: [Sdoi2009]Elaxia的路线 Time Limit: 4 Sec Memory Limit: 64 MB Submit: 921 Solved: 354 [Submit][Sta ...

  6. BZOJ-2326 数学作业 矩阵乘法快速幂+快速乘

    2326: [HNOI2011]数学作业 Time Limit: 10 Sec Memory Limit: 128 MB Submit: 1564 Solved: 910 [Submit][Statu ...

  7. 【bzoj1037】 ZJOI2008—生日聚会Party

    http://www.lydsy.com/JudgeOnline/problem.php?id=1037 (题目链接) 题意 有n个boy和m个girl排成一排,求使得任意一段的boy个数girl个数 ...

  8. MVC简介

    全名是Model View Controller,模型-视图-控制器,一种软件设计典范,用一种业务逻辑.数据.界面显示分离的方法组织代码,将业务逻辑聚集到一个部件里面,在改进和个性化定制界面及用户交互 ...

  9. electron加载jquery报错问题

    <!-- Insert this line above script imports --> <script>if (typeof module === 'object') { ...

  10. tcp MSL

    MSL(最大分段生存期)指明TCP报文在Internet上最长生存时间,每个具体的TCP实现都必须选择一个确定的MSL值.RFC 1122建议是2分钟. TIME_WAIT 状态最大保持时间是2 * ...