Mybatis笔记二:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
错误异常:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.test.dao.NarCodeMapper.getNarCode
出现这个原因:Mybatis的Mapper interface和xml文件的定义对应不上
大致通过如下几步来检查:
1.Mapper interface(接口)名称和Mapper xml名称是否保持一致
-------------------------------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<mappers>
<mapper resource="com/test/xml/NarCodeMapper.xml"/>
</mappers>
</configuration>
-----------------------------------------------------------
package com.test.dao;
public interface NarCodeMapper {
}
-------------------------------------------------------------------------------------------------------------------------------------------------------
2.Mapper xml中namespace属性值是否和Mapper interface(接口)所在(package名称+接口名称)保持一致。(本人就是在这里大意)
-------------------------------------------------------------------------------------------------------------------------------------------------------
<mapper namespace="com.test.dao.NarCodeMapper">
</mapper>
-----------------------------------------------------------
package com.test.dao;
public interface NarCodeMapper {
}
-------------------------------------------------------------------------------------------------------------------------------------------------------
3.Mapper interface(接口)中的函数是否与Mapper xml中(select,update,insert,delete)标签中的id属性值对应
4.去掉xml文件中文注释
5.随意在xml文件中加一个空格或者空行然后保存
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错误之org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
玩了MyBatis差不多有两年了,中间也玩过MyBatis-Plus,这个MyBatis-Plus其实与MyBatis的区别并不大.今天写博客业务代码的时候,犯一个初学者犯过的错误. 错误信息如下:o ...
- Maven项目使用mybatis报错 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
maven项目使用mybatis时,找不到mapper文件(.xml) 错误信息提示: 项目可以正常运行,但是在有请求到达服务器时(有访问数据库的请求),会出现报错!! 错误原因: mybatis没有 ...
- 使用maven整合mybatis时出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
分析原因是mybatis的映射文件的问题,首先进行分析排查: 1.检查mapper接口和对应的xml文件的包名是否对应 2.检查xml文件的namespace与mapper接口的包名是否对应 3.检查 ...
- maven 项目报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决
idea在使用maven构建的项目中使用mybatis时报错org.apache.ibatis.binding.BindingException: Invalid bound statement (n ...
- MyBatis笔记----报错Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ij34.model.UserMapper.selectUser
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@41cf53f9: startup ...
- MyBatis笔记----报错:Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方法
报错 Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound st ...
- 解决 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 以及MyBatis批量加载xml映射文件的方式
错误 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 的出现,意味着项目需要xml文件来 ...
- Spring boot结合mybatis开发的报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found),经过排查确定是没有找到xml的原因 ...
随机推荐
- L014-第三关课前linux命令及基础知识考试手把手实战解答小节
又是一周啊,以后保持一周一个微博吧. 这是一个堂解答考试题的课,那么就以题目来展开吧! 1.如何取得/etiantian文件的权限对应的数字内容,如-rw-r--r--为644,要求用命令获得644这 ...
- JS基础,课堂作业,健康体重评估
健康体重评估 <script> var sex = prompt("请输入性别:"); var height = parseInt(prompt("请输入身高 ...
- 搞懂.NET Framework 历史版本(2017年)
最近被.NET平台各种名词.以及各种版本弄得有些疑惑,开发和部署,对于开发平台版本选择是个基本问题,因此,花了些时间,学习汇总了有关.NET版本演进的历史. .NET简介 这个平台相信我们都知道,不过 ...
- php开发文章发布示例(正则表达式实例开发)
存档: post.php <form method="post" action="viewthread.php" target="_blank& ...
- eclipse集成testng插件(离线安装方式)
testng是一个优秀的测试框架,我们在开发自动化测试脚本或者框架的时候经常会用到这个框架,因为它不仅能方便的帮助我们管理测试类,而且它还提供了丰富的注解来支持各种测试场景的实现(参数化,数据提供者, ...
- 简述AQS原理
这是一道面试题:简述AQS原理 AQS核心思想是,如果被请求的共享资源空闲,则将当前请求资源的线程设置为有效的工作线程,并且将共享资源设置为锁定状态.如果被请求的共享资源被占用,那么就需要一套线程阻塞 ...
- Matplotlib用法
一 环境安装 Make sure you have installed numpy. 先安装np pip install matplotlib (Python2.X) pip3 install mat ...
- Python基础灬dict&set
字典dict 字典使用键-值(key-value)存储,具有极快的查找速度. dict基本操作 取值 a_dict = {'name': 'jack', 'age': 18} print(a_dict ...
- 初试Gevent – 高性能的Python并发框架
Gevent是一个基于greenlet的Python的并发框架,以微线程greenlet为核心,使用了epoll事件监听机制以及诸多其他优化而变得高效. 于greenlet.eventlet相比,性能 ...
- [Linux] Migrate plugins and setting for vim
Hot to migrate plugins and setting for vim from one computer to another ? Just copy ~/.vim and ~/.v ...