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的更多相关文章
- oracle+mybatis报错:BindingException("Invalid bound statement (not found): ")
oracle+mybatis报错:BindingException("Invalid bound statement (not found): ") 从mysql转到oracle数 ...
- 在使用mybatis的selectFromExample时出现Invalid bound statement (not found)错误
主要原因:运行项目在构建的时候只会默认的去加载resource资源文件里面的资源,其他地方的配置资源不会加载 .故没有读取到mybatis的MapperXml映射 结构如下 ============= ...
- myBatis的binding错误:Invalid bound statement (not found)
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误这个问题我找了好久,终于找到了正确的写 ...
- MyBatis使用动态代理报 invalid bound statement (not found) 错
这个问题网上大部分都说xml文件中的路径不对 或者是resources之类的问题,如果那些文章的解决方案解决不了你的问题的话,可以看一下我遇到的这种情况: 前提: mybatis-config.xml ...
- springboot+mybatis报错Invalid bound statement (not found)
今天做项目时报了一个错提示说Invalid bound statement (not found),也就是说mapper接口绑定.xml文件出错了,找不到指定的sql:原因是程序没有把.xml文件编译 ...
- mybatis:Invalid bound statement (not found)
[常规解决办法] 如果出现: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因 ...
- MyBatis绑定错误--BindingException:Invalid bound statement (not found)
如果出现: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因是Mapper i ...
- MyBatis笔记----报错Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ij34.model.UserMapper.selectUser
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@41cf53f9: startup ...
- mybatis错误之org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
玩了MyBatis差不多有两年了,中间也玩过MyBatis-Plus,这个MyBatis-Plus其实与MyBatis的区别并不大.今天写博客业务代码的时候,犯一个初学者犯过的错误. 错误信息如下:o ...
随机推荐
- 关于git,你需要知道一点命令
最近有朋友经常问git的一些操作,写在这里与大家分享,以后也不用一一解释了.惯例,这是基础分享,从安装开始说起: 安装: 去这里 https://git-scm.com/ 找到你所需要的版本,下载并安 ...
- Sublime Text 解决中文乱码
sublime text 是一款非常优秀的跨平台文本及源代码编辑器,本人非常喜欢,但是不支持GB2312和GBK编码在某些时候比较麻烦.可以通过向sublime text 中添加编码类型转换包(比如& ...
- 机器学习实战笔记(Python实现)-01-K近邻算法(KNN)
--------------------------------------------------------------------------------------- 本系列文章为<机器 ...
- linux快速删除海量文件
首先创建一个临时目录: /rubbish rsync --delete-before -a -H -v --progress --stats /rubbish /111 /111为目的目录 选项说明: ...
- native2ascii.exe 字符转码与反转码
本人最近在做OAF的二次开发,在看别人写的代码时,发现总有类似这样的语句:”\u65e0\u6548\u7684GP\u9879\u76ee\u7f16\u53f7“,这些语句其实是用Java_hom ...
- vi编辑器怎么设置tab缩进
首先,在命令中输入vim ~/.vimrc 按i进入编辑模式,输入set tabstop=4 按Esc进入命令模式,输入:wq保存退出即可.
- 部署私有Docker Registry和使用
环境 vmware虚拟机 Ip:192.168.190.139 Ip:192.168.190.140 Ip:192.168.0.122 registry Docker 1.12.2 Docker 版本 ...
- java弱引用之WeakHashMap相关资料
本人博客中有一篇文章对java中的引用有详细的介绍[http://www.cnblogs.com/javaee6/p/4763190.html],java中WeakHashMap这个类就是java弱引 ...
- 防火墙防DDOS攻击的简单设置
#Ping洪水攻击(Ping of Death) iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s - ...
- Facebook不相信所谓的员工能力等级。《长效商业英雄》(《哈佛商业评论》2016年11期),4星。
老牌管理杂志.本期我给4星.以下是书中一些信息的摘抄: 1:爱因斯坦曾说:“任何傻瓜都能让事情更复杂,只有天才能让事情变简单.”单就这一点来看,乔布斯无疑是天才中的天才.#137 2:通过让苹果聚焦于 ...