zoukankan      html  css  js  c++  java
  • 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没了,单元测试也通过了,邪门了!!!

    记录一下,如果有类似的错误的,先看控制台的提示信息吧!

  • 相关阅读:
    vim替换
    vim 常用快捷键 二
    vim撤销
    让你提升命令行效率的 Bash 快捷键
    快速正确的安装 Ruby, Rails 运行环境
    STL的常用算法
    Ubuntu下Postfix邮件服务器安装及基本的设置
    vim 参考手册
    指针 多维数组 数组指针 指针数组
    数学小抄
  • 原文地址:https://www.cnblogs.com/Guhongying/p/10780199.html
Copyright © 2011-2022 走看看