java.lang.IllegalStateException Unable to find a @SpringBootConfiguration错误解决方案
问题描述:
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test
问题截图:

出现原因:
在进行单元测试时我太懒了,随便建了个test包就进行测试,导致出现这个问题
解决方案:
将包名改为与其他分支一样的路径。就可以了!
如下图:

然后再执行就可以啦,亲测有效!!
————————————————
版权声明:本文为CSDN博主「陈豆粒」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_28643817/article/details/88063251
java.lang.IllegalStateException Unable to find a @SpringBootConfiguration错误解决方案的更多相关文章
- java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
写了一个单元测试test来启动activiti,controller放在src/main/java根目录下,test对应也放在src/test/java下,结果报错: java.lang.Illega ...
- maven打包错误:java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.118 sec <<< FAILURE! - in ...
- springboot测试启动报错java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
springboot测试启动报错: java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you ne ...
- SpringBoot测试类启动错误 java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
报错 java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Cont ...
- 使用SpringBoot整合MybatisPlus出现 : java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
解决方案一: 将测试类的包路径改为和主启动类的一致 解决方法二: 不想改测试类的路径 就在测试类上添加要测试的类的classes
- myeclipse 无法启动 java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
把myeclipse10 按照目录完整拷贝到了另外一台电脑, 另外的目录 原安装目录 D\:\soft\i\myeclipse10 新安装目录 E\:\soft\myeclipse10 双击启动失败, ...
- Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/Cppcc] due to a StackOverflowError. Possible root causes include a too low setting for -Xs
解决办法:(1)修改D:\Java\apache-tomcat-7.0.88\conf\catalina.properties (122line) (2)如org.apache.catalina.st ...
- tomcat启动时检测到循环继承而栈溢出的问题:Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/test] due to a StackOverflowError. Possible root causes include
最近在公司更新一个老项目的时候,发现部署项目后tomcat报错,错误如下: Caused by: java.lang.IllegalStateException: Unable to complete ...
- 处理eclipse启动时报java.lang.IllegalStateException
这是我写的第一篇博客,博客我来了: 我是好学的人,希望在这上面遇到志同道合的人,对技术有更高追求的人: 重启eclipse的时候报出来 An error has occurred, See the l ...
随机推荐
- jQuery 库中的 $() 是什么?
概述: $() 函数是 jQuery() 函数的别称. $() 函数用于将任何对象包裹成 jQuery 对象,接着就被允许调用定义在 jQuery 对象上的多个不同方法. 可以将一个选择器字符串传入 ...
- hadoop3.2+Centos7+5个节点主从模式配置
准备工作: hadoop3.2.0+jdk1.8+centos7+zookeeper3.4.5 以上是我搭建集群使用的基础包 一.环境准备 master1 master2 slave1 slave2 ...
- Linux 时间同步 05 chrony时间同步
Linux 时间同步 05 chrony时间同步 目录 Linux 时间同步 05 chrony时间同步 chrony 的优势: chrony包介绍 安装chrony 配置与外部时间服务器进行时间同步 ...
- 大话MySQL锁
一.锁介绍 不同存储引擎支持的锁是不同的,比如MyISAM只有表锁,而InnoDB既支持表锁又支持行锁. 下图展示了InnoDB不同锁类型之间的关系: 图中的概念比较多不好理解,下面依次进行说明. 1 ...
- 树莓派(4B)新手入门教程
前期准备 必要物料 树莓派4B 主机 Type-C 电源 内存卡(8G+) 一般建议一步到位64G 系统镜像 镜像写入工具 下载地址 镜像下载 官方下载地址: https://www.raspberr ...
- 2018年第九届蓝桥杯B组(201803-----乘积尾零)
标题题目:乘积尾零 如下的10行数据,每行有10个整数,请你求出它们的乘积的末尾有多少个零? 5650 4542 3554 473 946 4114 3871 9073 90 4329 2758 79 ...
- Thread线程控制之sleep、join、setDaemon方法的用处
Thread线程控制之sleep.join.setDaemon方法的用处 1. sleep方法 public static void sleep(long millis) throws Interru ...
- Java基础-数据类型及变量
Java基本语法 1.标识符(zhi) 含义:名字 类名.对象名.方法名.变量名.常量名-- 一个合法的标识符的组成:数字.字母._和$ 注意事项: 不能重复 不能以数字开头 区分大小写 不能以关键字 ...
- Linux调整lvm逻辑分区大小
转载自:https://www.cnblogs.com/kevingrace/p/5825963.html 个人记录一下 Linux下对lvm逻辑卷分区大小的调整(针对xfs和ext4不同文件系 ...
- Nginx安装步骤及本地浏览器不通解决方案,Nginx在Linux发布项目,Tomcat 与本地浏览器不通解决方案
Nginx安装步骤及本地浏览器不通解决方案 1.将安装包放到usr/local文件夹下 2..进入local目录,解压 tar -zxvf nginx-1.17.5.tar.gz 3.进入 nginx ...