mybatis: Invalid bound statement (not found)
来源:互联网 发布:常见的nosql数据库 编辑:程序博客网 时间:2024/06/08 02:33
org.apache.ibatis.binding.BindingException: Invalid bound statement(not found): *********/***Mapper(Dao).search***
原文:http://blog.sina.com.cn/s/blog_79560d930102uxcb.html
可能会有不少人遇到这个问题,特别是在用mybatis,spring的时候,没错,我也遇到了,所以就在网上找解决方案,确实找到了一些,如下(ctrl+V的,你懂得):
1. namespace 写的不对
2.UserDao中的方法 你在mapper里面没有写
3.UserDao的方法返回值是List,而select元素没有正确配置ResultMap,或者只配置ResultType!
4.重新编译一下
以上就是我找到的方法,但是!!!我的还有这个错误。。。
卧槽,花了一天的时间,看了各种各样的解决方法,连mybatis的源码都看了,
首先,报的错是
org.apache.ibatis.binding.BindingException: Invalid boundstatement (not found): com.baa.poi.service.UserService.findAllUser
它把我的service接口当成mapper了,所以。。。。。
最后,终于找到了一个集成好的项目,一一对照,终于。。。
我用的是
(这里的代码见评论,问候一下新浪的。。。。把我的代码屏蔽了)
(把我的评论也屏蔽了。。。。。。。。。,所以写成下面这样了,莫怪,能看懂就好)
beanclass="org.mybatis.spring.mapper.MapperScannerConfigurer"
property name="basePackage"value="com.baa.poi"
bean
修改后
beanclass="org.mybatis.spring.mapper.MapperScannerConfigurer"
property name="basePackage"value="com.baa.poi"
property name="markerInterface"value="com.baa.poi.dao.supermapper.SuperMapper"
bean
这个是让所有继承了SuperMapper的Mapper/Dao才映射相应的Mapper.xml
原文:http://blog.sina.com.cn/s/blog_79560d930102uxcb.html
0 0
- mybatis 异常:Invalid bound statement (not found) .
- mybatis错误: Invalid bound statement (not found)
- MyBatis:Invalid bound statement (not found)
- mybatis错误:Invalid bound statement (not found)
- mybatis BindingException: Invalid bound statement (not found)
- mybatis:Invalid bound statement (not found)
- mybatis: Invalid bound statement (not found)
- mybatis:Invalid bound statement (not found)
- mybatis错误:Invalid bound statement (not found)
- mybatis-- Invalid bound statement (not found)
- Mybatis异常:Invalid bound statement (not found)
- mybatis错误:Invalid bound statement (not found)
- mybatis:Invalid bound statement (not found)
- mybatis错误 Invalid bound statement (not found)
- mybatis Invalid bound statement (not found)
- [MyBatis]Invalid bound statement (not found)错误
- mybatis错误:Invalid bound statement (not found)
- MyBatis Invalid bound statement (not found)错误
- 华为OJ 初级:在字符串中找出连续最长的数字串
- IOS获取各个文件目录路径的方法以及相关沙盒机制理解
- 实现版本更新
- 暑期训练Breadth-First Search by Foxpower
- POJ 3172 Scales (剪枝深搜)
- mybatis: Invalid bound statement (not found)
- Unity粒子系统简介
- Spring MVC的自定义拦截器(登录)
- 【leetcode】144. Binary Tree Preorder Traversal
- ecshop二次开发手册【基本结构】
- UVALive 6437 Power Plant(最小生成树)
- bootstrap 响应式实用工具
- iOS中modal跳转总结
- 解决secureCRT7.3小键盘在vim编辑器里不能使用问题