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

这里 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

就是因为找不到mybatis的配置文件才报错的

只需要在测试时 右键 resources

改为test用的resources就行了 运行main下的项目时再改回去就行了

不过诡异的发现,在设置过test res之后,再改回main的res后也可以正常运行单元测试了……

可能是缓存之类的原因,不过还是需要先设置过一次test res才能正常运行单元测试的,最好在test时换成test res,避免又出现找不到的错误

idea 单元测试 mybatis spring-test 异常: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)的更多相关文章

  1. Spring扫面路径配置不全导致异常 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 的原因

    运行Junit测试类 package cn.bgodata.x.zero.service; import org.junit.Test; import org.junit.runner.RunWith ...

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

  3. 异常 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 解决方案

    原来是因为 AssetsMapper.xml 不知道为什么不见了,导致这个异常,在启动项目时的启动任务里调用到了它,然后因为没有这个xml,所以抛出异常 启动信息: C:\extend\Develop ...

  4. mybatis配置时出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

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

  5. IDEA+Maven+Mybatis 巨坑:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.rao.mapper.UserMapper.findAll

    org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.rao.mapper.User ...

  6. mybatis plus 报错 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 少了个范型

  7. MyBatis典型的错误org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    XXXmapper.java(接口) XXXmapper.xml(结果集映射) //此两个文件要在统一包下,且xml中的namespace是唯一的,为了区分须写成 该xml的全路径

  8. 【spring boot Mybatis】报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.newhope.interview.dao.UserMapper.add

    报错如下: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.newhope.i ...

  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. 基于 Docker 搭建 MySQL 主从复制

    本篇博文相对简单,因为是初次使用Docker,MySQL的主从复制之前也在Centos环境下搭建过,但是也忘的也差不多了,因此本次尝试在Docker中搭建. 根据网上教程走还是踩了一些坑,不过所幸最终 ...

  2. Python 模块化 自定义模块 (四)

    自定义模块 一个.py文件就是一个模块 创建以下三个文件: 运行test.py ,查看运行结果. #test.py print("this is test module") imp ...

  3. 说说Vue.js的v-for

    v-for的话,相比传统的jQuery的  $.each或者for循环要简洁明了的多, 比如在Jquery中我要遍历数据,通常如下几种方式: $.each(apps, function(i, app) ...

  4. PHP扩展功能----发送邮件

    1.下载PHPMailer源码 github下载 (测试使用的是5.2.2 版本) 2.注册并登录网易邮箱(其他邮箱均可)[用于配置用户名和三方登录授权码,以及发送人邮箱地址]  (1)开启POP3协 ...

  5. Eclipse查看.properties文件中文乱码

    在中文操作系统中,Eclipse中的Java类型文件的编码的默认设置是GBK,但是对Properties资源文件的编码的默认设置是ISO-8859-1.所以编辑Java文件中的中文不会出现问题,但编辑 ...

  6. datatable的excel导入,其中有关于datatables的很多参数设置

    datatable的excel导入,其中有关于datatables的很多参数设置 http://www.cnblogs.com/liyuhuan/p/5633095.html

  7. 使用mongodb提供的dotnet core sdk进行地理位置运算

    mongodb提供地理位置运算功能,比较常用的场景比如,先判断用户所在的街道,然后看看街道附近有啥餐厅,然后算算用户与餐厅的距离什么的,官网里提供了比较详细的demo介绍不同api的用法 此处记录下d ...

  8. LeetCode36.有效的数独 JavaScript

    判断一个 9x9 的数独是否有效.只需要根据以下规则,验证已经填入的数字是否有效即可. 数字 1-9 在每一行只能出现一次. 数字 1-9 在每一列只能出现一次. 数字 1-9 在每一个以粗实线分隔的 ...

  9. Oracle 日志挖掘(LogMiner)使用

    Logminer依赖于2个包:DBMS_LOGMNR和DBMS_LOGMNR_D,Oracle 11g默认已安装 Logminer 基本使用步骤 <1>. Specify a LogMin ...

  10. JAVA项目服务器部署

    1.下载 Java JDK 搜索jdk下载,然后进入JAVA官方网站jdk下载页,选择自己的对应的操作系统,点击下载 https://www.oracle.com/technetwork/java/j ...