idea 单元测试 mybatis spring-test 异常: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
因为在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)的更多相关文章
- 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 ...
- 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 ...
- 异常 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 解决方案
原来是因为 AssetsMapper.xml 不知道为什么不见了,导致这个异常,在启动项目时的启动任务里调用到了它,然后因为没有这个xml,所以抛出异常 启动信息: C:\extend\Develop ...
- mybatis配置时出现org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
如果出现: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因是Mapper i ...
- 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 ...
- mybatis plus 报错 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 少了个范型
- MyBatis典型的错误org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
XXXmapper.java(接口) XXXmapper.xml(结果集映射) //此两个文件要在统一包下,且xml中的namespace是唯一的,为了区分须写成 该xml的全路径
- 【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 ...
- Spring boot结合mybatis开发的报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found),经过排查确定是没有找到xml的原因 ...
随机推荐
- Mysql注入攻击与防御(思维导图笔记)
- [Luogu2622]关灯问题$||$(状压$DP$)
#\(\color{red}{\mathcal{Description}}\) \(Link\) 现有\(n\)盏灯,以及\(m\)个按钮.每个按钮可以同时控制这\(n\)盏灯--按下了第i个按钮,对 ...
- xcode Aborting commit: '~/Pods' remains in tree-conflict 错误的解决办法
在网上找了很多, 最后找到一个比较简单有较的 filename: 是出错的文件的绝对路径: xcode会提示 然后开终端: 1:svn remove --force filename 2:svn re ...
- sort_area_retained_size之tom解释
sort_area_retained_size 摘录一段asktom中tom的解释,对sort内存分配的方式进行了描述: it will allocate up to sort_area_retain ...
- Java并发编程(二)创建线程的三种方法
进程与线程 1. 进程 进程和代码之间的关系就像音乐和乐谱之间的关系一样,演奏结束的时候音乐就不存在了但乐谱还在:程序执行结束的时候进程就消失了但代码还在,而计算机就是代码的演奏家. 2. 线程 线 ...
- python class用法
创建一个名为 Restaurant 的类,其方法 __init__() 设置两个属性: name 和 type 1.创建一个名为 describe_restaurant() 的方法,前者打印前述两项 ...
- linux 学习第十三天(screen不间断会话、apache服务、SELinux安全子系统)
一.screen 命令不间断会话 1.安装screen(从系统镜像作为yum仓库安装) 1.1.加载系统镜像 1.2.mount /dev/cdrom /media/cdrom/ (挂在系统镜像) ...
- PHP-----PHP程序设计基础教程----第一章PHP开篇
本章内容知识体系如下所示: 一.PHP基础知识 1.1 Web技术 服务器与客户端 服务器:能够提供某种服务的电脑 客户端:想使用服务器所提供服务的电脑 服务器也是一台电脑,必须安装操作系统.否则就是 ...
- PHP实现多继承 - 通过接口的多继承特性(二)
原文地址:http://small.aiweimeng.top/index.php/archives/51.html 在上篇文章中写到php可以使用```Trait```实现代码的复用,下面介绍使用接 ...
- 【一】Spark基础
Spark基础 什么是spark 也是一个分布式的并行计算框架 spark是下一代的map-reduce,扩展了mr的数据处理流程. Spark架构原理图解 RDD[Resilient Distrib ...