MyBatis Error Mapped statements collection does not contain value for Com.inter.IOper

Source: Internet
Author: User

Home > Boutique Library > MyBatis Error Mapped statements collection does not contain value for Com.inter.IOper

MyBatis Error Mapped statements collection does not contain value for Com.inter.IOper

2015-04-09 Views (%)

[Abstract: In order to misappropriate the ioperation in the heart of Getallitems mode, the following problems emerged: Exception in thread main org.apache.ibatis.binding.BindingException : Invalid bound statement (not found): Com.inter.IOperation.getAllItems at Org.apache.ib]

The following error occurred when the program called the Getallitems method in the IOperation interface:

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. $Proxy 0.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.IOperati On.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)

There are several reasons why this error occurs:

1, the namespace is not written to, if using mapper, then <mapper namespace= "Com.inter.IOperation" > (IOperation is an interface, which contains method Getallitems)

2, Getallitems method is not in the Item.xml, and then execute Getallitems method will error

3. The return value of the Getallitems method is List<item>, while the SELECT element is not configured properly resultmap, or only Resulttype is configured

4, in the database connection related configuration file Configuration.xml, in <mappers> leaked <mapper resource= "Com/items/item.xml"/> (This is also the reason for my mistake this time)

MyBatis Error Mapped statements collection does not contain value for Com.inter.IOper

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.