关于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就只能看日志一行一行的分析,略显麻烦。

相关文章
|
2月前
|
测试技术 iOS开发 Perl
废弃第三方库导致的library not found for -lXXXXX(linker command failed ) 完美解决方法
废弃第三方库导致的library not found for -lXXXXX(linker command failed ) 完美解决方法
23 0
|
Ubuntu Unix Linux
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
|
2月前
|
前端开发 Java 微服务
Unable to find GatewayFilterFactory with name TokenRelay
Unable to find GatewayFilterFactory with name TokenRelay
|
JavaScript
Error: EMFILE: too many open files, watch 报错的解决方法
Error: EMFILE: too many open files, watch 报错的解决方法
639 1
cl.exe is unable to create an executable file. C compiler test failed.
cl.exe is unable to create an executable file. C compiler test failed.
169 0
command exec make executable file not found in %PATH%
command exec make executable file not found in %PATH%
206 0
command exec make executable file not found in %PATH%
|
移动开发 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是一个字符,导致运行错误。
1273 0