码迷,mamicode.com
首页 > 移动开发 > 详细

MyBatis笔记----报错Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ij34.model.UserMapper.selectUser

时间:2017-04-05 17:01:14      阅读:294      评论:0      收藏:0      [点我收藏+]

标签:code   logs   mode   package   iba   command   文件   refresh   source   

信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@41cf53f9: startup date 
[Wed Apr 05 16:48:12 CST 2017]; root of context hierarchy 四月 05, 2017 4:48:12 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from class path resource [com/ij34/mybatis/applicationContext.xml] Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ij34.model.UserMapper.selectUser at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:230) at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:48) at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:65) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58) at com.sun.proxy.$Proxy4.selectUser(Unknown Source) at com.ij34.bean.Test.main(Test.java:24)

 

       解决:

  1. 检查xml文件所在的package名称是否和interface对应的package名称一一对应
  2. 检查xml文件的namespace是否和xml文件的package名称一一对应
  3. 检查函数名称能否对应上
  4. 去掉xml文件中的中文注释
  5. 随意在xml文件中加一个空格或者空行然后保存

MyBatis笔记----报错Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ij34.model.UserMapper.selectUser

标签:code   logs   mode   package   iba   command   文件   refresh   source   

原文地址:http://www.cnblogs.com/tk55/p/6669485.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!