mybatis一个怪异的问题: Invalid bound statement (not found)
2013-10-29 14:48
453 查看
Invalid bound statement (not found): cn.com.dao.UserDao.selectByUser
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.selectByUser(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for cn.com.dao.UserDao.selectByUser
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
我检查了半天也没看出什么问题来,后来把mapper的xml select 语句重写。问题竟然好了。
出了这种问题:
1.
<mapper namespace="cn.com.dao.UserDao">
mapper的namespace写的不对!
2.
UserDao的方法在UserDao.xml中没有,然后执行UserDao的方法会报此错
3. 删除配置文件里中文的注释,保存.
4. 如果你确认没有以上问题,请任意修改下对应的xml文件,比如删除一个空行,保存.问题解决...
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.selectByUser(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for cn.com.dao.UserDao.selectByUser
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
我检查了半天也没看出什么问题来,后来把mapper的xml select 语句重写。问题竟然好了。
出了这种问题:
1.
<mapper namespace="cn.com.dao.UserDao">
mapper的namespace写的不对!
2.
UserDao的方法在UserDao.xml中没有,然后执行UserDao的方法会报此错
3. 删除配置文件里中文的注释,保存.
4. 如果你确认没有以上问题,请任意修改下对应的xml文件,比如删除一个空行,保存.问题解决...
相关文章推荐
- mybatis一个怪异的问题: Invalid bound statement (not found)
- mybatis一个怪异的问题: Invalid bound statement (not found)
- mybatis一个怪异的问题: Invalid bound statement (not found)
- mybatis一个怪异的问题: Invalid bound statement not found 作者及来源: babyblue - 博客园 收藏到→_→: 摘要: mybatis一个怪异
- mybatis一个怪异的问题: Invalid bound statement (not found)
- 关于mybatis “org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)” 错误的问题。
- 关于IDEA工具在springboot整合mybatis中出现的Invalid bound statement (not found)问题
- Eclipse中Mybatis无法读取xml文件的问题(mybatis绑定错误-- Invalid bound statement (not found))
- mybatis一个怪异的问题: Invalid bound statement not found":
- 关于mybatis “org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)” 错误的问题
- Mybatis中Invalid bound statement (not found): com.atguigu.mybatis.dao.EmployeeMapper.getEmpById报错问题
- Maven工程中不识别mybatis的Mapper.xml文件问题——mybatis:Invalid bound statement (not found):
- 关于mybatis Invalid bound statement (not found) 问题
- 关于mybatis “org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)” 错误的问题。
- mybatis一个怪异的问题: Invalid bound statement not found
- "Invalid bound statement (not found): com.sitech.admin.dao.TbOpenAbilityInfoDao.findAbilityReadyUp"mybatis配置文件bug
- mybatis错误 Invalid bound statement (not found)
- MyBatis典型的错误org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- Mybatis在idea中错误:Invalid bound statement (not found)
- 使用mybatis 产生Invalid bound statement (not found)错误原因