您的位置: 首页 > 文章 > 解决springboot启动报java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need 解决springboot启动报java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need 分类: 文章 • 2024-02-13 22:28:22 解决springboot启动报java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test 分析项目的目录结构,有没有启动类。 下面我拿我的项目举个例子 上图可知,我的启动类放错了位置,没有在包的根目录上。 再运行问题解决!!!