首页 > 精品文库 > 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的更多相关文章

  1. Mybatis报错——Mapped Statements collection already contains value for

    解决办法: 看看你的mybatis-config.xml <mappers>     <mapper resource="mapper/SeckillDao.xml&quo ...

  2. 报错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 ...

  3. Spring+Mybatis整合报错Mapped Statements collection does not contain value原因之一

    报错如下: ### Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements coll ...

  4. Springboot+Mybatisplus替换mybatis整合报错Mapped Statements collection does not contain value

    问题一: mybatisPlus完全兼容mybatis,一般来说直接替换掉就可以了,如果mybatis的数据源不能取消创建的话,就注掉mybatisplus的数据源 //@Configurationp ...

  5. mybatis启动报错Mapped Statements collection already contains value for com.autoyol.mapper.trans.TransDispatchingMapper解决

    1.检查sqlsession配置,在applicationContext文件中.检查mybatis配置文件. 2.检查TransDispatchingMapper.java 是接口类,无注解. 3.T ...

  6. mybatis 报错Result Maps collection does not contain value for java.lang.Integer

    重点:报错的方法和xml文件不一定是错误的位置,如果有多个xml文件,必须检查所有的文件 搜索  resultMap="java.lang.Integer" 找到对应的文件,改为  ...

  7. 解决mybatis报错Result Maps collection does not contain value for java.lang.Integer

    解决办法:1.检查mybatis的xml配置 2.在某处肯定有配错了的,如"resultMap" -->"resultType" [html] view ...

  8. MyBatis中出现Mapped Statements collection does not contain value

    引用csdn上一大神的解决方法: 经过排查,解决上述异常的过程如下: 1.确定xml文件中<mapper namespace=""/>中的namespace是否路径正确 ...

  9. 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 ...

随机推荐

  1. 11-cp 命令总结

  2. linux下PHP7环境搭建

    LAMP环境版本 操作系统:Centos 7 Mysql:5.7.11 Apache:2.4.18 PHP:7.0.4     安装Mysql   下载链接:http://dev.mysql.com/ ...

  3. open-flash-chart2

    链接 http://www.oschina.net/news/10797/Open-Flash-Chart-2-0 open-flash-chart.rar http://123-reg-suspen ...

  4. The resource identified by this request is only capable of generating responses with characteristics

    [转]今天在调试springMVC的时候,在将一个对象返回为json串的时候,浏览器中出现异常: The resource identified by this request is only cap ...

  5. Redis必须注意的慢查询问题

    今天解析服务在查询Redis的Set数据过程中抛出timeout exception,产生异常的方法是: db.SetMembers(key); 这个API返回结果是指定set内的所有kv对象: 解决 ...

  6. the useful for loop

    cp four_letter four_letter_bk for i in `ls /media/10TB/Stats/Assembly_marker` do cd /media/10TB/Stat ...

  7. Sublime Text快捷键和常用插件推荐

    Sublime Text快捷键: Ctrl+Shift+P:打开命令面板 Ctrl+P:搜索项目中的文件 Ctrl+G:跳转到第几行 Ctrl+W:关闭当前打开文件 Ctrl+Shift+W:关闭所有 ...

  8. 浅谈malloc()与free()

    malloc()与free() l  函数原型 malloc函数的函数原型为:void* malloc(unsigned int size),它根据参数指定的尺寸来分配内存块,并且返回一个void型指 ...

  9. 绘制图形与3D增强技巧(二)----直线图元

    一. glBegin(GL_LINES); glend(); 二.线带和线环 glBegin(GL_LINE_STRIP); glend(); glBegin(GL_LINE_LOOP); glend ...

  10. 【BZOJ-1179】Atm Tarjan + SPFA

    1179: [Apio2009]Atm Time Limit: 15 Sec  Memory Limit: 162 MBSubmit: 2407  Solved: 993[Submit][Status ...