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的原因 ...
随机推荐
- angular中的$http服务
$http是ng内置的一个服务.是简单的封装了浏览器原生的XMLHttpRequest对象. 写法1 $http({ method: "GET", url: 'data.json' ...
- 使用Python的BeautifulSoup 类库采集网页内容
BeautifulSoup 一个分析.处理DOM树的类库.可以做网络爬虫.模块简称bs4. 安装类库 easy_install beautifulsoup4 pip install beautiful ...
- Android 学习1
使用eclipse做为开发IDE, 导包快捷键 在显红的地方按shift+ctrl+o 另外自动补全使用alt+/
- python-模块详解
模块: 模块的分类: 第三方模块/扩展模块:没在安装python解释器的时候安装的那些功能 自定义模块:你写的功能如果是一个通用的功能,那你就把它当做一个模块 内置模块:安装python解释器的时候跟 ...
- python4 - 字典
字典 定义:字典是无序的,它不能通过偏移来存取,只能通过键来存取. 特点:内部没有顺序,通过键来读取内容,可嵌套,方便我们组织多种数据结构,并且可以原地修改里面的内容,属于可变类型. 创建字典.{}, ...
- 4星|《财经》2018年第15期:电动飞机、无人小飞机、AI无人机
<财经>2018年第15期 总第532期 旬刊 本期主题是AI.有多篇国内AI行业的比较深入的调查报告,比较有意思的有:电动飞机.无人小飞机.AI无人机.欧盟通用数据保护条例.Amazon ...
- 算法笔记(c++)--回文
算法笔记(c++)--回文 #include<iostream> #include<algorithm> #include<vector> using namesp ...
- Python:装饰器的简单理解
1.装饰器的本质是函数,主要用来装饰其他函数,也就是为其他函数添加附加功能 2.装饰器的原则: (1) 装饰器不能修改被装饰的函数的源代码 (2) 装饰器不能修改被装饰的函数的调用方式 3.实现装饰器 ...
- 404_NOTE_Foung_软工6
目录 NABCD分析引用 N(Need,需求): A(Approach,做法): B(Benefit,好处): C(Competitors,竞争): D(Delivery,交付): 初期 中期 个人贡 ...
- Eclipse项目导入到Android Studio中
背景 最近需要将Eclipse中的android项目导入到Android Studio中!倒腾一番,记录如下! 步骤1 打开Android Studio(下文称AS),选择Import project ...