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"/>(这也是我这次错误的原因)

时间: 2024-10-15 01:30:41

mybatis报错Mapped Statements collection does not contain value for com.inter.IOper的相关文章

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

1.检查sqlsession配置,在applicationContext文件中.检查mybatis配置文件. 2.检查TransDispatchingMapper.java 是接口类,无注解. 3.TransDispatchingMapper.xml的命名空间就是TransDispatchingMapper接口类的地址,这个不能写错,否则会报错. 4.xml文件格式要求严格,如大于号,小于号,注释符号多了几个--,文件第一行留有空格,${}写错成中括号等,都会报错,所以除了仔细还是仔细,在开发过

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

解决办法:1.检查mybatis的xml配置 2.在某处肯定有配错了的,如"resultMap" -->"resultType" [html] view plain copy<select id="getNumDayMoney" resultMap="java.lang.Integer" parameterType="java.lang.Integer"> <![CDATA[ sel

mybatis错误 Mapped Statements collection does not contain value for

java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for 在unit里测试怎么也通不过,最后终于找到问题,原来是命名空间没写对,如果使用mapper,则 <mapper namespace="com.sitech.mapper.StudentMapper"> 空间中一定要写上Mapper的名称,否则就会报错.

MyBatis:Mapped Statements collection does not contain value for xxx

完整错误信息: 十一月 03, 2015 10:01:08 上午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [springmvc] in context with path [/xinghe-platform-web] threw exception [Request processing failed; nested exception is org.mybati

搭建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 does not contain value for mapper.BatchCustomer.findBatchCustomerOneToOne### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does

mybatis报错:A query was run and no Result Maps were found for the Mapped Statement、、Property [login_ip] not found on type [com.thinkgem.jeesite.common.permission.entity.PremissUser]问题解决

今天在做ssm项目的时候出现了: 先是出现 了错误: mybatis报错:A query was run and no Result Maps were found for the Mapped Statement 这是因为Dao.xml中的select标签中必须指定要返回的值的类型(注意:是返回值的单个类型,即如果你是返回一个List<User>的话,需要指定的是User) 具体的这种错误的解决办法见:https://www.cnblogs.com/isme-zjh/p/11757155.h

java.lang.IllegalArgumentException: XXX is ambiguous in Mapped Statements collection

问题的出现: 在后台添加一个新栏目的时候,照着程序已有原来的代码添加新的功能时,文件没有错误.点击新的栏目的时候报了java.lang.IllegalArgumentException: selectPageByExample is ambiguous in Mapped Statements collection (try using the full name including the namespace, or rename one of the entries). 解决: 在网上查找了

Mapped Statements collection already contains value for

解决了! 参考的网址:http://www.cnblogs.com/langtianya/archive/2013/03/18/2966491.html 错误原因是由于使用ibatis的F554281Mapper.xml实现接口F554281Mapper.java中的方法的时候的id有重复的值,比如 <select id="find81OrderBySovr01" resultMap="81ResultMap" parameterType="java

Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for &hellip;

编译通过并且运行web成功后,访问的页面不需要连接数据库,不牵扯到反射调用实体类就不会报错, 报错内容如下: [WARNING] org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exce