错误截图

解决措施

此异常的原因是由于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. k8s 组件介绍__单Master集群部署

    参考链接:https://github.com/opsnull/follow-me-install-kubernetes-cluster kubernetes 概述 1.kubernetes 是什么 ...

  2. 【将门创投】AI 往期技术分享

    计算机视觉 1. 嘉宾:商汤科技CEO 徐立 文章回顾:计算机视觉的完整链条,从成像到早期视觉再到识别理解 2. 嘉宾:格灵深瞳CTO 赵勇 文章回顾:计算机视觉在安防.交通.机器人.无人车等领域的应 ...

  3. vultr搭建ss

    我在Ubuntu1604上运行的sslocal,但是发现firefox无法链接ss代理,后来用的chromium才成功连接上, ---------------------------- 下面是正文 - ...

  4. VBA二次学习笔记(2)——两个Excel表内容比较

    说明(2018-9-3 22:38:58): 1. 就是之前问同事要来的作业,有两个格式一样的Excel文件,一个是正确答案,一个是员工作答的.通过代码将两个文件进行比对,把不同之处列出来. 正文: ...

  5. Hadoop源码系列(一)FairScheduler申请和分配container的过程

    1.如何申请资源 1.1 如何启动AM并申请资源 1.1.1 如何启动AM val yarnClient = YarnClient.createYarnClient setupCredentials( ...

  6. k8s的使用

    . 查看 kubectl 的状态 kubectl version . 查看集群信息 kubectl cluster-info . 查看节点信息 kubectl get nodes . 创建一个发布 k ...

  7. 通用 正则表达式 C# (.NET)Regex 总结

    [参考]C#正则表达式Regex类的用法    语法: 1. new System.Text.RegularExpressions.Regex("\\$\\d{1,2}\\}"). ...

  8. 24小时学通Linux内核之调度和内核同步

    心情大好,昨晚我们实验室老大和我们聊了好久,作为已经在实验室待了快两年的大三工科男来说,老师让我们不要成为那种技术狗,代码工,说多了都是泪啊,,不过我们的激情依旧不变,老师帮我们组好了队伍,着手参加明 ...

  9. 从头配置,开发 cocos2dx 3.14.1

    要使用cocos2dx写一个麻将测试工具. 配置流程如下: 1. 下载安装最新版本的VS(VS2017): https://www.visualstudio.com/zh-hans/downloads ...

  10. macOS Sierra(10.12.6), odoo(11.0), Python(3.5.4)配置

    欣闻odoo11支持python3环境了,赶紧在mac平台尝试一下: 前期设置,参考另篇文章:macOS Sierra 10.12.6 odoo 10.0 开发环境配置 因为odoo11尚未正式发布, ...