首页 > 代码库 > mybatis一个怪异的问题: Invalid bound statement not found
mybatis一个怪异的问题: Invalid bound statement not found
ssm中报一下错误:
invalid bound statement (not found): me.tspace.pm.dao.userdao.getuser
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 $proxy22.getuser(unknown source)
........................
........................
caused by: java.lang.illegalargumentexception: mapped statements collection does not contain value for me.tspace.pm.dao.userdao.getuser
at org.apache.ibatis.session.configuration$strictmap.get(configuration.java:775)
at org.apache.ibatis.session.configuration.getmappedstatement(configuration.java:615)
at org.apache.ibatis.session.configuration.getmappedstatement(configuration.java:608)
at org.apache.ibatis.binding.mappermethod$sqlcommand.<init>(mappermethod.java:176)
... 34 more
三种情况:
1.
<mapper namespace="me.tspace.pm.dao.userdao">
mapper的namespace写的不对!!!注意系修改。
2.
userdao的方法在userdao.xml中没有,然后执行userdao的方法会报此
3. userdao的方法返回值是list<user>,而select元素没有正确配置resultmap,或者只配置resulttype!
4. 如果你确认没有以上问题,请任意修改下对应的xml文件,比如删除一个空行,保存.问题解决...
转载自http://blog.csdn.net/two_people/article/details/51984516
mybatis一个怪异的问题: Invalid bound statement not found