MyBatis Error:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)(IDEA)
2017-12-08 00:00
961 查看
摘要: 关于我在使用IDEA配置Mybatis框架的问题。(主要是IDEA的操作上的问题)
JDK:1.8
项目结构:
MyBatis:依赖
遇到问题:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
解决方法:
①确保mybatis-config、mapper.xml中的映射路径正确;
②看target目录下是否有对应的mapper.xml,如果没有,就在resource目录下创建一个mapper路径
并把mapper.xml剪切进去。注意!在java文件夹下的xml是扫描不到的,所以编译后target中的mapper中(如3处)没有StudentMapper.xml。在将1处的Mapper.xml剪切入2处后,再次编译,3处会出现mapper.xml。
③重点来了!!!一般情况下到这里已经解决了可是我还是有BindingException错误。接下来我修改了一下mapper.xml的文件名。
原来我是通过这种方式创建xml的,所以生成的xml如下图
没有.xml后缀,我给文件名加上了后缀.xml后程序完美运行!!!
完美运行!!!
留个赞吧~(●'◡'●)~
JDK:1.8
项目结构:
MyBatis:依赖
遇到问题:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
解决方法:
①确保mybatis-config、mapper.xml中的映射路径正确;
②看target目录下是否有对应的mapper.xml,如果没有,就在resource目录下创建一个mapper路径
并把mapper.xml剪切进去。注意!在java文件夹下的xml是扫描不到的,所以编译后target中的mapper中(如3处)没有StudentMapper.xml。在将1处的Mapper.xml剪切入2处后,再次编译,3处会出现mapper.xml。
③重点来了!!!一般情况下到这里已经解决了可是我还是有BindingException错误。接下来我修改了一下mapper.xml的文件名。
原来我是通过这种方式创建xml的,所以生成的xml如下图
没有.xml后缀,我给文件名加上了后缀.xml后程序完美运行!!!
完美运行!!!
留个赞吧~(●'◡'●)~
相关文章推荐
- Idea+myBatis报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- IDEA异常解决: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis绑定错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- Maven 遇到mybatis 发生org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- 当mybatis整合spring后出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- mybatis使用bug:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- mybatis绑定错误org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis的org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- idea报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.money.*
- MyBatis笔记----报错Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ij34.model.UserMapper.selectUser
- mybatis出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis maven打包出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
- 【spring boot Mybatis】报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.newhope.interview.dao.UserMapper.add
- spring+mybatis整合报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis “org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)”
- mybatis使用时org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):的错误
- MyBatis笔记----报错:Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方法
- Mybatis笔记二:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- mybatis: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
- IDEA的maven项目出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误解决方法