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 ...
随机推荐
- 创建多个Oracle数据库及相应的实例
转 http://blog.csdn.net/luiseradl/article/details/6972217 对于使用过SQL Server数据库的用户可以会对Oracle中的数据库的实例的概念理 ...
- android和httpClient
一.说起来都是泪 各大组织不同步,可是我想用别人的库. 二.谷歌和阿帕奇的爱恨情仇 初,谷歌安卓新出,库中自带HttpClient 4.0测试预览版.为与安卓保持API同步,HTTPClient不敢大 ...
- 关于最近折腾的ubuntu12.10
win7旗舰正版up1 UltraISO + ubuntu-12.10-desktop-i386.iso + 4GKingston = 启动U盘 USB HDD 启动 进入ubuntu桌面,安装,磁盘 ...
- "此站点已经禁用应用程序"在sharepoint 2013中通过v2013部署app提示该错误
该错误的原文是:the apps are disabled in this site 可以在yahoo或者bing上搜索这个错误,可以找到解决办法: msdn上也有该错误解决办法,但是如果搜索中文,目 ...
- Mysql-报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost
报错:1130-host ... is not allowed to connect to this MySql server 解决方法: 1. 改表法. 可能是你的帐号不允许从远程登陆,只能在l ...
- 【BZOJ-1853&2393】幸运数字&Cirno的完美算数教室 容斥原理 + 爆搜 + 剪枝
1853: [Scoi2010]幸运数字 Time Limit: 2 Sec Memory Limit: 64 MBSubmit: 1817 Solved: 665[Submit][Status] ...
- html中span不显示背景
如果不在span中输入任何文本,span设置的背景图将无法显示出来.解决办法就是设置为块元素,然后设置固定的宽高. 参考:http://blog.csdn.net/jarniyy/article/de ...
- JSP的JSTL标签使用
JSTL标签和asp.net中的webform控件很像,但是功能确比asp.net的强很多. 配置过程,从最简单的项目开始: 1.下载JSTL标签库:http://archive.apache.org ...
- 研究dotnet动态语言IronPython(对应Java的Groovy)
Java的标配动态语言Groovy,两者搭配可以说是完美!大规模运用的项目,如:Jenkins,通过动态语言可以弥补先天系统缺陷的bug,再者就是加强自己的业务逻辑等. 那么换过dotnet上,对应的 ...
- hdu 5035 概率题
直接推公式的题目了.... Refer:http://blog.csdn.net/u012139398/article/details/39458623 https://www.zybuluo.com ...