SSM单元测试时出现:Failed to load ApplicationContext的一种可能解决办法
Failed to 出现 解决办法 可能 一种 单元测试 SSM
2023-09-11 14:22:20 时间
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没了,单元测试也通过了,邪门了!!!
记录一下,如果有类似的错误的,先看控制台的提示信息吧!
相关文章
- Failed to write to mysql.slow_log
- hive启动时 Terminal initialization failed; falling back to unsupported java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
- Android中java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/LocalDate;错误的原因和解决方法
- Uncaught DOMException: Failed to construct 'Worker' 解决方法
- Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
- 记一次elementUI Icon 加载无效的问题。并且提示错误 Failed to decode downloaded font:
- Git 常见错误 之 error:error: src refspec main does not match any/ error: failed to push some refs to 简单解决
- linux下连接无线网出现nl80211: Could not configure driver mode nl80211: deinit ifname=wlan1 disabled_11b_rates=0 wlan1: Failed to initialize driver interface
- Android 模拟机出现Installation failed due to invalid URI!错误
- Failed to complete obtain psql count Master gp_segment_configuration Script Exiti
- Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
- 【服务器】Web server failed to start. Port 80 or configure this application to listen on another port.
- SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"
- Flutter web问题:Failed to load network image
- Xamarin部署时遇到错误: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
- Python 常见问题 之 from .cv2 import * ImportError: numpy.core.multiarray failed to import
- Ubuntu sudo apt-get update提示 Failed to fetch,解决办法
- Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext
- xhprof查看性能测试图一直报错:failed to execute cmd: " dot -Tpng"多种因素解决方案
- Mac M1使用Docker报错 Failed to get D-Bus connection: No such file or directory的解决方案
- 使用locate命令解决matlab2020a的Failed to load module "canberra-gtk-module"的提示信息
- SpringBlade 端口占用 Web server failed to start. Port 80 was already in use.
- 码云,git push后出现错误 error:failed to push some refs to 'xxxxx‘