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 ...
随机推荐
- python多进程web爬虫-提升性能利器
背景介绍: 小爬我最近给部门开发了一系列OA的爬虫工具,从selenium前端模拟进化到纯requests后台post请求爬取,效率逐步提升.刚开始能维持在0.5秒/笔.可惜当数据超过2000笔后,爬 ...
- KubeCon + CloudNativeCon论坛2019上海
2019年,KubeCon + CloudNativeCon和Open Source Summit在将在中国共同举办一场活动. In 2019, KubeCon + CloudNativeCon an ...
- Complex类的实现
#include<iostream> #include<cmath> using namespace std; class complex{ public: complex() ...
- Xamarin 自定义 ToolbarItem 溢出菜单实现(Popover/Popup) 弹出下拉效果
使用 Rg.Plugins.Popup 插件 1. 新建 PopupMenu.xaml <?xml version="1.0" encoding="utf-8& ...
- 后台发送get请求
第一步:编写Controller,让后台去请求接口 package controller; import java.util.List; import org.springframework.bean ...
- Apache的功能模块
本人这几天一直在看apache相关的书籍,稍微说下apache的结构 本人的制图: Apache一共有五层功能结构. 从底层到上依次为: 第一层: 名称:操作系统支持层 功能:操作系统可以提供底层功能 ...
- 004-CSS怎样让背景充满整个屏幕
<!doctype html><html><body> ...Your content goes here...</body></html> ...
- Java 多线程之Timer与ScheduledExecutorService
1.Timer管理延时任务的缺陷 a.以前在项目中也经常使用定时器,比如每隔一段时间清理项目中的一些垃圾文件,每个一段时间进行数据清洗:然而Timer是存在一些缺陷的,因为Timer在执行定时任务时只 ...
- Bioinfo online workshop
http://icb.med.cornell.edu/index.html%3Fpage_id=2068.html 1. Datacamp https://www.datacamp.com/cours ...
- 转载 usb_alloc_coherent 和 usb_free_coherent
今天做移植的时候,随手记录一下,今天所遇到的问题解决方法. 在linux2.6.34和之前的代码中还可以使用usb_buffer_alloc 和 usb_buffer_free 这两个函数,在2.6. ...