关于Unable to find a @SpringBootConfiguration错误解决方法

简介: SpringBoot项目上跑测试类,加上@SpringBootTest运行报错,其中一种错误就是未加载到启动类,导致整个启动类挂了,详情看下方内容

今天在测试程序组时,突然发现测试类跑不起来,报了一大片错误。

屏幕截图 2021-10-30 151916.png

细看整个错误,大概就是缺少启动类或未加载到启动类,导致整个程序跑不动。而且上面已经明确提醒了@SpringBootTest(classes = ...),就是让你配置启动类。既然如此我们就配置好,再跑一跑试试看

屏幕截图 2021-10-30 152408.png

先加上一个启动类,运行之

屏幕截图 2021-10-30 152425.png

成功解决问题了。其实有报错的bug都不难解决,按照错误信息分析和追查就好了。不报错的逻辑业务bug就只能看日志一行一行的分析,略显麻烦。

相关文章
|
19天前
|
Python
【Python3报错】Fatal error in launcher: Unable to create process using ……
【Python3报错】Fatal error in launcher: Unable to create process using ……
|
2月前
|
前端开发 Java 微服务
Unable to find GatewayFilterFactory with name TokenRelay
Unable to find GatewayFilterFactory with name TokenRelay
|
Ubuntu
解决办法:GLib-ERROR **: Creating pipes for GWakeup: Too many open files
解决办法:GLib-ERROR **: Creating pipes for GWakeup: Too many open files
145 0
|
数据安全/隐私保护
提示 you neet to root to perform this command 的解决办法
提示 you neet to root to perform this command 的解决办法
|
iOS开发
Xcode报错:Failed to find a suitable device for the type SimDeviceType解决方法
Xcode报错:Failed to find a suitable device for the type SimDeviceType解决方法
189 0
|
移动开发 Linux Shell
$‘\r‘: command not found的解决方法
在Linux系统中,运行Shell脚本,出现了如下错误: one-more.sh: line 1: $'\r': command not found 1 出现这样的错误,是因为Shell脚本在Windows系统编写时,每行结尾是\r\n,而在Linux系统中行每行结尾是\n,所以在Linux系统中运行脚本时,会认为\r是一个字符,导致运行错误。
1268 0