SSM单元测试时出现:Failed to load ApplicationContext的一种可能解决办法
SSM单元测试时出现:
严重: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@402bba4f] to prepare test instance ………………
网上有很多相关错误的解决办法,但是没有我想要的,真是cd!!!
然后看控制台的输出好像有这么一句提示:type filter class: java.lang.ClassNotFoundException: org.springframework.stereotype.Contorller
回到spring的配置文件,发现下面几行的前面有个黄色的感叹号,定眼一瞧,握草,这句waring很眼熟:Ignoring non-present type filter class: java.lang.ClassNotFoundException: org.springframework.stereotype.Contorller
<context:component-scan
base-package="com.example">
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
</context:component-scan>
一时半会也不知道怎么搞它,最后我将上面的那段复制后删去,再粘贴回去,warning没了,单元测试也通过了,邪门了!!!
记录一下,如果有类似的错误的,先看控制台的提示信息吧!
SSM单元测试时出现:Failed to load ApplicationContext的一种可能解决办法的更多相关文章
- junit单元测试报错Failed to load ApplicationContext,但是项目发布到tomcat浏览器访问没问题
junit单元测试报错Failed to load ApplicationContext,但是项目发布到tomcat浏览器访问没问题,说明代码是没问题的,配置也没问题.开始时怀疑是我使用junit版本 ...
- spring junit 做单元测试,报 Failed to load ApplicationContext 错误
spring junit 做单元测试,报 Failed to load ApplicationContext 错误. 查找了好一会,最后发现.@ContextConfiguration(locatio ...
- 启动Eclipse弹出:Failed to load JavaHL Library 错误框的解决办法
一.问题背景描述: eclipse安装完svn插件以后,在启动时出现:Failed to load JavaHL Library. These are the errors that were en ...
- Eclipse运行错误:Failed to load the JNI shared library的解决办法
出现上述错误的原因是环境变量配置出问题,查看JAVA_HOME这一环境变量的值是否正确. 操作步骤如下, 1.右键“我的电脑”->属性 ↓ 2.打开“高级系统设置”,如下图: ↓ 3.选择“环境 ...
- The Add-in 'VMDebugger' failed to load or caused an exception.....的解决办法
异常如图: 解决办法: (把VS的设置导出来,做出相应修改后,再导入,问题就可以解决了) 1. 在Visual Studio中选择 Tools --> Import and Export Set ...
- junit测试时,出现java.lang.IllegalStateException: Failed to load ApplicationContext
课程设计要求进行junit测试,我是在已经做好的ssh项目上做的测试,测试类代码如下 package com.zhang.web.services; import static org.junit.A ...
- 小型SSM项目出现Failed to load ApplicationContext错误的解决方法(个人向)
使用单元测试的时候,出现了Failed to load ApplicationContext错误,在添加了一个新的Mapper.xml文件才出现的,在保证其他配置文件没有出错的情况下,检查mapper ...
- maven单元测试报java.lang.IllegalStateException: Failed to load ApplicationContext
报这个异常java.lang.IllegalStateException: Failed to load ApplicationContext的时候,通常是因为applicationContent.x ...
- 集成JUnit测试错误java.lang.IllegalStateException: Failed to load ApplicationContext
1 详细错误信息 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.t ...
随机推荐
- input实现上传
很多时候我们会用到上传,实现一个普通的上传也很简单,不用引用繁琐的插件 一个普通的上传 <form action="=upload" method="post&qu ...
- selenium--控制浏览器和简单元素操作
控制浏览器1.driver.maximize_window() #浏览器最大化2.driver.set_windows_size(480*800) #浏览器设置成移动端大小(480*800),参数数字 ...
- postman headers 请求参数和MD5加密签名
postman 变量可以这样写:{{timestamp}} ,也可以用系统的,{{$timestamp}},这样就不用给自己赋值了,但在 pre-requestScript中是获取不到这个值的 所以我 ...
- HDFS组件性能调优:数据平衡
生产系统中什么情况下会添加一个节点呢? 1 增加存储能力 disk 2 增加计算能力 cpu mem 如果增加是的是存储能力,说明存储已接近饱和或者说过段时间就会没有剩余的空间给作业来用.新加的节点存 ...
- Qt3D
---------------------------------------------- 概述 - 请阅读QtHelp: Qt 3D Overview https://www.kdab.com/o ...
- Cannot locate BeanDefinitionParser for element [scoped-proxy]
指定使用 CGLIB 而不使用 JDK 生成代理对象:注意:此两个标签必须同时出现,不然会报:Cannot locate BeanDefinitionParser for element [scope ...
- vue前端面试题知识点整理
vue前端面试题知识点整理 1. 说一下Vue的双向绑定数据的原理 vue 实现数据双向绑定主要是:采用数据劫持结合发布者-订阅者模式的方式,通过 Object.defineProperty() 来劫 ...
- C#基本方法(瞎写写)
public static IEnumerable<T> GetAll<T>() where T : new() { using (var conn = new Profile ...
- oracle传输表空间相关
1.convert tablespaceconvert tablespace源端库执行:convert tablespace 'TPS_DATA' to platform 'AIX-Based Sys ...
- harbor pull 失败
STep1: 显示下面的错误 Error response from daemon: unknown: The image is not signed in Notary Step2: 这儿暂时不要选 ...