mybatis报错Mapped Statements collection does not contain value for com.inter.IOperation.getAllItems
来源:互联网 发布:informatica windows 编辑:程序博客网 时间:2024/05/16 00:40
在程序调用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.IOperation.getAllItems
- Mybatis报错—— Mapped Statements collection does not contain value for com.mapper.DepartmentMapper
- 报错:Mapped Statements collection does not contain value for com.fzl.organation.vo.OrganizationMapping
- spring+mybatis项目搭建测试报错Mapped Statements collection does not contain value for
- mybatis错误 Mapped Statements collection does not contain value for
- mybatis错误 Mapped Statements collection does not contain value for
- mybatis错误 Mapped Statements collection does not contain value for
- MyBatis:Mapped Statements collection does not contain value for xxx
- mybatis错误 Mapped Statements collection does not contain value for
- myBatis配置报Mapped Statements collection does not contain value for
- Spring+Mybatis整合报错Mapped Statements collection does not contain value原因之一
- mybatis 错误之 Mapped Statements collection does not contain value
- batis 错误 Mapped Statements collection does not contain value for
- Mapped Statements collection does not contain value for...
- Mapped Statements collection does not contain value for RelateMarketingMapper....解决办法
- Mapped Statements collection does not contain value for *
- Mapped Statements collection does not contain value for
- Mapped Statements collection does not contain value for的解决方法
- [leetcode]C语言:172 Factorial Trailing Zeroes
- 用PageTransformer打造更好的动画效果
- Linux下嵌入式学习方法
- 花生棒2代:穿透内网 让NAS一起去旅行
- VMware虚拟机安装Linux英文改中文系统并更新yum安装输入法
- mybatis报错Mapped Statements collection does not contain value for com.inter.IOperation.getAllItems
- JAVA中连接mysql数据库
- 第二周作业
- Linux程序运行中加载动态库
- Android中RelativeLayout布局各个属性含义解释
- 为ie和chrome FF单独设置样式的“条件注释法”、“类内属性前缀法”、“选择器前缀法”、实现方法 案例(推荐)
- 秋天里的思念
- A program to print Fahrenheit-Celsius table with floating-point values
- POJ 3067 Japan(树状数组)