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