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.deppon.gis.module.job.shared.domain.HaoDuanEntity.updateBatch
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.deppon.gis.module.job.shared.domain.HaoDuanEntity.updateBatch
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:346)
at $Proxy9.insert(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:231)
at com.deppon.gis.module.job.server.dao.impl.SendHaoDuanDao.update(SendHaoDuanDao.java:29)
at com.deppon.roadTest.SendHaoD.send(SendHaoD.java:76)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
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.deppon.gis.module.job.shared.domain.HaoDuanEntity.updateBatch
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.deppon.gis.module.job.shared.domain.HaoDuanEntity.updateBatch
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:123)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:110)
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:338)
... 28 more
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.deppon.gis.module.job.shared.domain.HaoDuanEntity.updateBatch
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:594)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:436)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:428)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:120)
... 34 more

原因出在item在foreach中定义的,结果在上面引用的,找不到参数。所以报错 IllegalArgumentException: Mapped Statements collection does not contain value for 

单元测试报错:Mybatis中数据库语句错误的更多相关文章

  1. Mybatis中选择语句的使用:<choose>标签、分区排序 Row_num() over ()函数的使用呢

    1.Mybatis中数据库语句的选择 使用: <choose>       <when test="relationType=='L'">          ...

  2. 镜像切换Logreader Agent报错:分发数据库中可能存在不一致的状态(续)

    报错: 分发数据库中可能存在不一致的状态: dist_backup_lsn {00000030:000001ba:0004},dist_last_lsn {00000030:000001cd:0004 ...

  3. 【.net core 入坑】.net core 3.0 报错:在 FETCH 语句中选项 NEXT 的用法无效

    目录 1.事故现场: 2.分析及解决方案: 1.事故现场: 在项目中使用.net core 3.0,在EF链接sqlserver2008,在程序中使用了分页用的skip和take,程序报错: 在 FE ...

  4. maven报错非法字符:\65279 错误

    开发中一个项目很早就报这个错,maven报错非法字符:\65279 错误,今天终于忍无可忍要解决它 :编译java文件的时候,有些java文件报非法字符 \65279错误,在网上找和很多 方法,也试了 ...

  5. 转:maven报错非法字符:\65279 错误

    开发中一个项目很早就报这个错,maven报错非法字符:\65279 错误,今天终于忍无可忍要解决它 :编译java文件的时候,有些java文件报非法字符 \65279错误,在网上找和很多 方法,也试了 ...

  6. junit单元测试报错Failed to load ApplicationContext,但是项目发布到tomcat浏览器访问没问题

    junit单元测试报错Failed to load ApplicationContext,但是项目发布到tomcat浏览器访问没问题,说明代码是没问题的,配置也没问题.开始时怀疑是我使用junit版本 ...

  7. 连接数据后,当执行查询语句报错:ORA-01219: 数据库未打开: 仅允许在固定表/视图中查询

    参考博客:http://blog.csdn.net/lanchengxiaoxiao/article/details/40982771 1.在cmd窗口通过sqlplus连接数据库 C:\Users\ ...

  8. ALERT日志中常见监听相关报错之二:ORA-3136错误的排查

    最近在多个大型系统中遇到此问题,一般来说假设client未反映异常的话能够忽略的. 假设是client登陆时遇到ORA-12170: TNS:Connect timeout occurred,能够參考 ...

  9. Oracle ALERT日志中常见监听相关报错之二:ORA-3136错误的排查 (转载)

    近期在多个大型系统中遇到此问题,一般来说如果客户端未反映异常的话可以忽略的.如果是客户端登陆时遇到ORA-12170: TNS:Connect timeout occurred,可以参考 http:/ ...

随机推荐

  1. C++语法小记---经典问题之一(malloc和new的纠缠)

    malloc和new以及free和delete的区分 new和malloc以及delete和free的区别 new和delete是C++的关键字,malloc和free是库函数 new和delete会 ...

  2. 视图相关SQL

    前面介绍了视图的概念和作用,接下来简单的用实例SQL来展现视图. 例如:首先,创建表e_information.表e_shareholder: 然后插入表数据等,在此,这简单的部分我就省略了,直接写视 ...

  3. Saas Erp以及分销 助手

    首先贴一下相关的截图 SaasErp 登陆页 Saas Erp主页 Saas Erp 其中的商品页 Saas Erp  打印模板设计页 分销助手登录页/手势密码页/主页 1.SaaS是Software ...

  4. Java中lambda(λ)表达式的语法

    举一个排序的例子,我们传入代码来检查一个字符串是否比另一个字符串短.这里要计算: first.length() - second.length() first和second是什么?他们都是字符串.Ja ...

  5. APP自动化 -- 获取toast元素的文本内容

    一.toast元素 1.表现形式:toast元素就是下图中  “操作成功” 那个一闪而过的标签. 2.特殊点:因为一闪而过,时间太短,用UIAutomatorView截屏截不到. 二.获取方法 1.用 ...

  6. 【Nginx】并发量太高,Nginx扛不住?这次我错怪Nginx了!!

    写在前面 最近,在服务器上搭建了一套压测环境,不为别的,就为压测下Nginx的性能,到底有没有传说中的那么牛逼!具体环境为:11台虚拟机,全部安装CentOS 6.8 64位操作系统,1台安装部署Ng ...

  7. Python os.makedev() 方法

    概述 os.makedev() 方法用于以major和minor设备号组成一个原始设备号.高佣联盟 www.cgewang.com 语法 makedev()方法语法格式如下: os.makedev(m ...

  8. luogu4443 coci 2017 Dajave

    题目 给出一个长度为2^M的排列,元素分别是0, 1, 2, ... , 2^M -1. 选择其中某个非空连续子序列,然后允许交换这个排列中某两个不同的数,然后使得这个连续子序列的所有数的按位异或(b ...

  9. SSRS - 请求因 HTTP 状态 401 失败: Unauthorized。

    原因: 1.SSRS报表服务器停止了,重启就可以了 2.用户没有权限 3.用户登录密码过期了,重设密码就可以了(如果用户是安装了client的话,直接让他远程登录改一下密码)

  10. 最优化算法【牛顿法、拟牛顿法、BFGS算法】

    一.牛顿法 对于优化函数\(f(x)\),在\(x_0\)处泰勒展开, \[f(x)=f(x_0)+f^{'}(x_0)(x-x_0)+o(\Delta x) \] 去其线性部分,忽略高阶无穷小,令\ ...