mybatis一个怪异的问题: Invalid bound statement not found 作者及来源: babyblue - 博客园收藏到→

xiaoxiao2021-02-28  78

mybatis一个怪异的问题: Invalid bound statement not found

  作者及来源: babyblue - 博客园      收藏到 →_→: 摘要: mybatis一个怪异的问题: Invalid bound statement (not found) "mybatis一个怪异的问题: Invalid bound statement not found": 关键词: mybatis  一个  怪异  问题  invalid  bound  statement  found

 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文件,比如删除一个空行,保存.问题解决...

转载请注明原文地址: https://www.6miu.com/read-79249.html

最新回复(0)