mybatis一个怪异的问题: Invalid bound statement not found 作者及来源: babyblue

来源:互联网 发布:图片变动画软件 编辑:程序博客网 时间:2024/06/08 20:17

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

阅读全文
0 0
原创粉丝点击