错误截图

解决措施

此异常的原因是由于mapper接口编译后在同一个目录下没有找到mapper映射文件而出现的。

通常我们在配置SqlSessionFactory时会有如配置

 <!-- 配置SqlSessionFactory -->
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 设置MyBatis核心配置文件 -->
<property name="configLocation" value="classpath:resources/mybatis/mybatis-config.xml" />
<!-- 设置数据源 -->
<property name="dataSource" ref="dataSource" />
<!-- 它表示我们的Mapper文件存放的位置,当我们的Mapper文件跟对应的Mapper接口处于同一位置的时候可以不用指定该属性的值。 -->
<property name="mapperLocations" value="classpath:/mappings/**/*.xml" />
<!-- 那么在Mapper文件里面就可以直接写对应的类名 而不用写全路径名了 -->
<!-- 跟mybatis中<typeAliases>作用一样 -->
<!-- <property name="typeAliasesPackage" value="com.jeenotes.ssm.pojo"/> -->
</bean>

重点是第8行代码,他代表我们的mapper文件存放路径,如果不配置这一行的话,默认路径是你存放dao文件目录,这也就是为何把xml文件放在dao目录跟xxxDao.java文件放在一起不报错,放在其他路径就报错问题所在。

本文地址:http://www.cnblogs.com/niceyoo/articles/8733251.html

mybatis 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绑定错误--BindingException:Invalid bound statement (not found)

    如果出现: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因是Mapper i ...

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

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

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

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

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

  6. idea 单元测试 mybatis spring-test 异常: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    因为在idea中必须在test下才能进行单元测试,所以进行单元测试时,ssm的项目会因为找不到resourece中的配置文件而报错 这里 org.apache.ibatis.binding.Bindi ...

  7. Mybatis笔记二:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    错误异常:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.test.dao.N ...

  8. 【mybatis】mybatis访问报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 或者 feign被调用方使用的mybatis总报空指针异常java.lang.NullPointerException,而变量都没有问题的情况

    mybatis访问报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 需要检查的步骤: ...

  9. BindingException: Invalid bound statement (not found)问题排查:SpringBoot集成Mybatis重点分析

    重构代码,方法抛出异常:BindingException: Invalid bound statement (not found) 提示信息很明显:mybatis没有提供某方法 先不解释问题原因和排查 ...

随机推荐

  1. Asp.Net WebApi 跨域设置

    跨越问题主要发生在客户端ajax请求时,为了安全设置,默认webapi是不允许ajax跨越请求的,不过有方法设置让支持跨越,我说说最常见的两种方法 一.jquery jsonp 缺点:JSONP也有局 ...

  2. iOS- UITextView与键盘回收与键盘遮挡输入框

    一.UITextView 可以实现多行输入的文本框,基本属性与UITextField相似,可以输入多行,可以滚动.UITextView还有个代理方式- (BOOL)textView:(UITextVi ...

  3. 【资料下载区】【GMT43相关代码、资料下载地址】更新日期2017/06/28

    [GMT43相关文档][更新中...] GMT43原理图(PDF)下载GMT43说明书(PDF)下载GMT43机械结构尺寸(PDF)下载 [GMT43相关例程代码][ARM][更新中...] 基于HA ...

  4. Build GMP on 64bit Windows

    1.MSYS2 环境搭建 1.1.安装 msys2 的主页地址: http://www.msys2.org/ 下载32位或64位,我这里 下载了64位 msys2-x86_64-20161025.ex ...

  5. 【python】——python3 与 python2 的那些不兼容

    python2 python3 string.uppercase string.ascii_uppercase string.lowercase string.ascii_lowercase xran ...

  6. SSH下authorized_keys, id_rsa, id_rsa.pub, known_hosts作用

    一.known_hsots ssh会把你每个你访问过计算机的公钥(public key)都记录在~/.ssh/known_hosts.当下次访问相同计算机时,OpenSSH会核对公钥.如果公钥不同,O ...

  7. Ubuntu下安装Kafka Manager

    参考 : kafka管理器kafka-manager部署安装 下载Kafka Manager,并进行打包,由于Kafka manager是由scala写的,所以需要由sbt的支持 git clone ...

  8. 【静默】在RHEL 6.5上静默安装Oracle 18c

    [静默]在RHEL 6.5上静默安装Oracle 18c Oracle 18c.18c其实就是12.2.0.2,19c就是12.2.0.3.db_home.zip 安装包大概4.25G,解压后有8.9 ...

  9. nginx default_server的作用

    用来处理没有成功匹配server_name的请求 https://www.oschina.net/question/12_3565 https://segmentfault.com/a/1190000 ...

  10. Oracle 11G 安装文档

    一. 将文件win32_11gR2_database_1of2.zip和win32_11gR2_database_2of2.zip解压. 注意:这两个文件解压到同一个目录下,即:将Components ...