错误: Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for studentDao.insert
详细错误信息:
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for studentDao.insert
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for studentDao.insert
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:200)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
at cn.mgy.dao.impl.StudentDoImpl.insert(StudentDoImpl.java:14)
at cn.mgy.test.StudentTest.insert(StudentTest.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for studentDao.insert
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:860)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:693)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:686)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
... 26 more
解决方法:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper namespace="studnetDao"> <!--修改为 <mapper namespace="studentDao">-->
<insert id="insert" useGeneratedKeys="true" keyProperty="studentId">
INSERT INTO tb_student(STUDENT_NAME, STUDENT_PWD)
VALUES (#{studentName}, #{studentPwd})
</insert>
</mapper>
错误: Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for studentDao.insert的更多相关文章
- 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 ...
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.bjsxt.mapper.PeopleMapper
报错信息: Type Exception Report Description The server encountered an unexpected condition that prevente ...
- 搭建Mybatis 出现 Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for mapper.BatchCustomer.findBatchCustomerOneToOne
Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection doe ...
- java - mybatis:java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for
当遇见java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for 错误的时候 ...
- Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for …
编译通过并且运行web成功后,访问的页面不需要连接数据库,不牵扯到反射调用实体类就不会报错, 报错内容如下: [WARNING] org.springframework.web.util.Nested ...
- Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value f ...
- .IllegalArgumentException: Mapped Statements collection does not contain 异常一例【我】
更新代码后发现几乎所有的sql查询都报错,类似下面: java.lang.RuntimeException: org.mybatis.spring.MyBatisSystemException: ne ...
- Caused by: java.lang.IllegalArgumentException: Parameter Maps collection does not contain value for com.bj186.crm.mapper.UserMapper.Integer
在使用SSM整合myBatis的过程中遇到了这个问题. 问题的原因: 把parameterType错误的写成了parameterMap 解决办法: 将parameterMap修改为parameterT ...
- java.lang.IllegalArgumentException: Result Maps collection does not contain value for java.lang.Integer
今天做springmvc+mybatis+spring的项目的时候发现了一个异常.如下: org.apache.ibatis.builder.IncompleteElementException: C ...
随机推荐
- Nginx CONTENT阶段 concat模块
L67 concat_delimiter : 根据js 指定 分隔符 比如 “|” 那么每个文件分隔符为 “|” concat_types : 指定要合并文件的类型 concat_unique : s ...
- C++ 中 double、 long double、long 和 long long
double 属于浮点类型,具体为双精度浮点类型,通常为 IEEE-754 64 位浮点类型. long double 也属于浮点类型,具体为扩展精度浮点类型,其精度不低于double,具体由编译器和 ...
- DP的优化总结
一.预备知识 \(tD/eD\) 问题:状态 t 维,决策 e 维.时间复杂度\(O(n^{e+t})\). 四边形不等式: 称代价函数 w 满足凸四边形不等式,当:\(w(a,c)+w(b,d)\l ...
- 第一模块:Python基础(二)
目录 1.变量 常量 2.用户交互和注释 程序交互 注释 字符串 布尔型(bool) 格式化输出 运算符 while 循环 @(开发基础) 1.变量 变量用于存储要在计算机程序中引用和操作的信息.它们 ...
- windows下安装oracle11g测试是否成功与监听器问题和网页控制台登录
测试步骤1:请执行操作系统级的命令:tnsping orcl 测试步骤 2:请执行操作系统级的命令:sqlplus system/password@orcl 安装完oracle后要启动oracle服务 ...
- Multi-View 3D Reconstruction with Geometry and Shading——Part-1
From PhDTheses Multi-View 3D Reconstruction with Geometry and Shading 计算机视觉的主要任务就是利用图像信息能智能理解周围的世界. ...
- iptables防火墙规则积累
1.内网IP地址端口映射: 通过访问本机地址的3389端口,可以访问到192.168.1.139的远程桌面服务: -A PREROUTING -p tcp -m tcp --dport 3389 ...
- 快速删除C#代码中的空白行
使用正则表达式 ^\s*\n 选中内容或类全部替换为空
- JavaWeb之DButils整理
一.DBUtils介绍 apache 什么是dbutils,它的作用 DBUtils是java编程中的数据库操作实用工具,小巧简单实用. 用前导包!!!DBUtils包!!! 二.DBUtils的三 ...
- 人工智能初识(百度ai)
目前的人工智能做了什么? 语音识别:小米的小爱同学,苹果的siri,微软的Cortana语音合成:小米的小爱同学,苹果的siri,微软的Cortana图像识别:交通摄像头拍违章,刷脸解锁手机等视频识别 ...