mybatis报错Mapped Statements collection does not contain value for com.inter.IOper
首页 > 精品文库 > mybatis报错Mapped Statements collection does not contain value for com.inter.IOper
mybatis报错Mapped Statements collection does not contain value for com.inter.IOper
2015-04-09 浏览(52)
[摘要:正在顺序挪用IOperation接心中的getAllItems方式时,涌现了以下毛病: Exception in thread main org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.inter.IOperation.getAllItems at org.apache.ib]
在程序调用IOperation接口中的getAllItems方法时,出现了以下错误:
Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.inter.IOperation.getAllItems
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:178)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:38)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:49)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:42)
at com.sun.proxy.$Proxy0.getAllItems(Unknown Source)
at analysis.ReviewsMining.processProcessedReviews(ReviewsMining.java:88)
at analysis.ReviewsMining.main(ReviewsMining.java:152)
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.inter.IOperation.getAllItems
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.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:176)
出现这种错误有几种原因:
1、命名空间没写对,如果使用mapper,则<mapper namespace="com.inter.IOperation">(IOperation是个接口,里面含有方法getAllItems)
2、getAllItems方法在item.xml中没有,然后执行getAllItems方法会报错
3、getAllItems方法的返回值是List<Item>,而select元素没有正确配置ResultMap,或者只配置了ResultType
4、在与数据库连接相关的配置文件Configuration.xml中,在<mappers>中漏了<mapper resource="com/items/Item.xml"/>(这也是我这次错误的原因)
mybatis报错Mapped Statements collection does not contain value for com.inter.IOper的更多相关文章
- Mybatis报错——Mapped Statements collection already contains value for
解决办法: 看看你的mybatis-config.xml <mappers> <mapper resource="mapper/SeckillDao.xml&quo ...
- 报错Mapped Statements collection does not contain value for com.atguigu.mybatis.dao.EmployeeMapperPlus
报错Mapped Statements collection does not contain value for com.atguigu.mybatis.dao.EmployeeMapperPlus ...
- Spring+Mybatis整合报错Mapped Statements collection does not contain value原因之一
报错如下: ### Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements coll ...
- Springboot+Mybatisplus替换mybatis整合报错Mapped Statements collection does not contain value
问题一: mybatisPlus完全兼容mybatis,一般来说直接替换掉就可以了,如果mybatis的数据源不能取消创建的话,就注掉mybatisplus的数据源 //@Configurationp ...
- mybatis启动报错Mapped Statements collection already contains value for com.autoyol.mapper.trans.TransDispatchingMapper解决
1.检查sqlsession配置,在applicationContext文件中.检查mybatis配置文件. 2.检查TransDispatchingMapper.java 是接口类,无注解. 3.T ...
- mybatis 报错Result Maps collection does not contain value for java.lang.Integer
重点:报错的方法和xml文件不一定是错误的位置,如果有多个xml文件,必须检查所有的文件 搜索 resultMap="java.lang.Integer" 找到对应的文件,改为 ...
- 解决mybatis报错Result Maps collection does not contain value for java.lang.Integer
解决办法:1.检查mybatis的xml配置 2.在某处肯定有配错了的,如"resultMap" -->"resultType" [html] view ...
- MyBatis中出现Mapped Statements collection does not contain value
引用csdn上一大神的解决方法: 经过排查,解决上述异常的过程如下: 1.确定xml文件中<mapper namespace=""/>中的namespace是否路径正确 ...
- 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 ...
随机推荐
- 写一个 nodejs npm应用 - webhere
前言.没图不说话,先上图. What's webhere? 有没有遇到这样的场景:写程序的时候,需要访问一个文件,这个文件 需要是放到一台web服务器上,但是你不是开发的web应用. 所以呢,你不得不 ...
- HTTP Pipeline
什么是HTTP Pipeline http管线化是一项实现了多个http请求但不需要等待响应就能够写进同一个socket的技术,仅有http1.1规范支持http管线化,1.0并不支持:采用管线化的请 ...
- optiontransferselect例子
Struts2 OptionTransferSelect标签 动态赋值: 1.html片面: <td class="td2"> <s:optiontransfer ...
- 使用Git时一些问题的处理
更新日志: 2016.06.04 晚 添加 git push --force (用于删除高版本的commit) 2015.11.29 晚 添加冲突处理工具Meld的教程 添加在GitHub上Rever ...
- CSS Hack技术介绍及常用的Hack技巧
一.什么是CSS Hack? 不同的浏览器对CSS的解析结果是不同的,因此会导致相同的CSS输出的页面效果不同,这就需要CSS Hack来解决浏览器局部的兼容性问题.而这个针对不同的浏览器写不同的CS ...
- 直播CDN架构随想
互联网内容载体变迁历程,文字--图片/声音--视频--VR/AR----从直播1.0秀场时代(YY).2.0游戏直播(斗鱼.虎牙.熊猫)到如今全民直播3.0泛生活娱乐时代(映客.花椒),国外直播App ...
- 理解 Paxos
Paxos是前段时间刚获得图灵奖的大神Leslie Lamport所提出的,是用来解决分布式系统中的一致性问题的算法.该算法对于分布式系统的重要性,在这里不再赘言.了解过Paxos的朋友应该都知道,要 ...
- ContentObserver监听数据库·变化
//短信Uri Uri smsUri = Uri.parse("content://sms"); //使用ContentReslover注册·监听器 getContentResol ...
- ubuntu14.04完全卸载mysql
1.删除 mysql1 sudo apt-get autoremove --purge mysql-server-5.0 2 sudo apt-get remove mysql-server 3 su ...
- android 概述 及四大组件
目录: 概述 四大组件 UI布局 概述 android studio中,gen很bin文件夹合并为built文件夹 四大组件 包括: 活动,服务,内容提供者,广播接收者 活动是一种包含用户界面的组件 ...