错误异常: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)的更多相关文章

  1. mybatis使用时org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):的错误

    最近在使用mybatis时,出现了 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 这 ...

  2. mybatis错误之org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    玩了MyBatis差不多有两年了,中间也玩过MyBatis-Plus,这个MyBatis-Plus其实与MyBatis的区别并不大.今天写博客业务代码的时候,犯一个初学者犯过的错误. 错误信息如下:o ...

  3. Maven项目使用mybatis报错 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

    maven项目使用mybatis时,找不到mapper文件(.xml) 错误信息提示: 项目可以正常运行,但是在有请求到达服务器时(有访问数据库的请求),会出现报错!! 错误原因: mybatis没有 ...

  4. 使用maven整合mybatis时出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    分析原因是mybatis的映射文件的问题,首先进行分析排查: 1.检查mapper接口和对应的xml文件的包名是否对应 2.检查xml文件的namespace与mapper接口的包名是否对应 3.检查 ...

  5. maven 项目报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决

    idea在使用maven构建的项目中使用mybatis时报错org.apache.ibatis.binding.BindingException: Invalid bound statement (n ...

  6. 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 ...

  7. 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 ...

  8. 解决 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 以及MyBatis批量加载xml映射文件的方式

    错误 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 的出现,意味着项目需要xml文件来 ...

  9. Spring boot结合mybatis开发的报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found),经过排查确定是没有找到xml的原因 ...

随机推荐

  1. jquery.validate使用 - 5

    一些常用的验证脚本 不会写js了,只能从网上找一些常用的验证脚本. // 手机号码验证jQuery.validator.addMethod("mobile", function(v ...

  2. [Cocos2d-html5]关于压缩

    使用的是2.2版本,压缩时要注意文件顺序,main.js文件最好排在最后一个,避免错误.

  3. python4 - 字典

    字典 定义:字典是无序的,它不能通过偏移来存取,只能通过键来存取. 特点:内部没有顺序,通过键来读取内容,可嵌套,方便我们组织多种数据结构,并且可以原地修改里面的内容,属于可变类型. 创建字典.{}, ...

  4. Selenium2+python自动化-CSS定位语法

    前言 一些人在使用selenium定位元素时,用的是xpath定位,因为xpath基本能解决定位的需求.css定位往往被忽略掉了,其实css定位也有它的价值,css定位更快,语法更简洁.这一篇css的 ...

  5. Raft 一致性协议算法 《In search of an Understandable Consensus Algorithm (Extended Version)》

    <In search of an Understandable Consensus Algorithm (Extended Version)>   Raft是一种用于管理日志复制的一致性算 ...

  6. div不设置高度背景颜色或外边框不能显示的解决方法

    在使用div+css进行网页布局时,如果外部div有背景颜色或者边框,而不设置其高度,在浏览时出现最外层Div的背景颜色和边框不起作用的问题. 大体结构<div class="oute ...

  7. html js div随鼠标移动

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  8. Windows和Linux系统如何退出python命令行

    python命令行是新手学习python过程中必须要学的一个工具,下面我们来看一下怎么退出python命令行. 第一种方式: 使用python提供的exit()函数,linux平台和windows平台 ...

  9. Python3 匿名函数

    一 匿名函数 lambda函数也叫匿名函数,语法结构如下: lambda x:x+1 x --> 形参 x+1 --> 返回值,相当于return x+1 实例(Python3.0+): ...

  10. 20181023-10 Alpha阶段第2周/共2周 Scrum立会报告+燃尽图 07

    作业要求参见:https://edu.cnblogs.com/campus/nenu/2018fall/homework/2290 Scrum master:范靖旋 一.小组介绍 组长:王一可 组员: ...