(原创)常见报错不常见原因之——org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
来源:互联网 发布:淘宝优惠劵怎么设置 编辑:程序博客网 时间:2024/06/05 19:38
错误日志:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found).....
常见原因:由于mybatis只要mapper.xml文件有错误,就经常会报这用映射错误。可能是
namespace错误、resultMap错误(type错误、属性错误)
sql语句中字段名与自定义resultmap中column不符等等
经过排查,这些都没错
单元测试也是一直报错,哪怕mapper.xml是最简单的sql语句
曾一度怀疑是编译的问题,因为mapper.xml是复制过来的
精疲力尽之际,看到网上有人贴了一张图,是一张idea项目结构图,灵光一现,蓦然回首,才发现,我的资源文件夹名名名错了。。。。
我写的是mapper,然而应该是mappers。。。。
两个启发:
一、公司项目结构很大,子项目下很少看到基础的配置方式,导致这么低级的错误花了一下午加晚饭才搞出来(很菜还不投降)
<bean id="masterSqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="wecashDatasource" /> <property name="mapperLocations"> <list> <value>classpath*:config/mappers/*</value> </list> </property>
在基础依赖里找到了。。。。。。早点看到就不至于这样了
二、自己搞不出来就赶紧上网找,自然很多都是废话,但是总有那么一个神圣的时刻灵光一现
阅读全文
0 0
- (原创)常见报错不常见原因之——org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- 一行代码求数组的最大值与最小值
- java服务器用struts2通过JSONObject返回json数据库
- Topcoder参赛入门
- hdu2025 查找最大元素(C语言)
- 游戏素材分享站点
- (原创)常见报错不常见原因之——org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- 关于JFinal的一些小知识
- 《自己手动写一个编译器、连接器》二(3)
- 面对对象-抽象类,接口,内部类
- Java中DecimalFormat中的四舍五入的用法
- Linux下桥接模式的设置
- java控制台输出图书馆管理系统(只用java代码不用数据库和GUI等)
- CVPR2017 all paper list
- 2012-2013 ACM-ICPC, Asia Tokyo Regional Contest F.Never Wait for Weights(带权并查集模板)