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 ...
随机推荐
- [leetcode]108. Convert Sorted Array to Binary Search Tree构建二叉搜索树
构建二叉搜索树 /* 利用二叉搜索树的特点:根节点是中间的数 每次找到中间数,左右子树递归子数组 */ public TreeNode sortedArrayToBST(int[] nums) { r ...
- java数组之基本语义
A[] a; B[] b=new B[5];print(b)print(b.length)a={new A(),new A()}//聚合初始化:隐式使用new在堆中创建A[] d=new A[];a= ...
- 表单绑定v-model
表单控件在实际开发中是极为常见的.特别是对于用户信息的提交,需要大量的表单.Vue中使用v-model指令来实现表单元素和数据的双向绑定.此篇记录下其原理,以及当时学习时候的一些小尝试以及修饰符. v ...
- TurtleBot3 Waffle (tx2版华夫)(10)自主导航(A2激光雷达)
1)[Remote PC] 启动roscore $ roscore 2)[TurBot3] 启动turbot3 $ roslaunch turbot3_bringup minimal.launch 3 ...
- .NET 云原生架构师训练营(模块二 基础巩固 RabbitMQ Masstransit 介绍)--学习笔记
2.6.6 RabbitMQ -- Masstransit 介绍 Masstransit 是什么 Quickstart 消息 Message Masstransit 是什么 Masstransit 是 ...
- 【.NET 与树莓派】使用 GPIO 库
上回老周在说准备工作的时候,提到过树莓派用金属盒散热的事情.有朋友会说,加了金属盒子接线不方便,就算用了"T"形板,毕竟是把导线延长了的.其实扩展板就是把原有的引脚引出(类似于延长 ...
- Openstack 启动一个实例(九)
Openstack 启动一个实例(九) 创建一个提供者网络: # 创建一个提供者网络: openstack network create --share --external --provider-p ...
- HAProxy + keepalived 高可用集群代理
HAProxy + keepalived # 1 安装keepalived: yum install keepalived -y # 2 修改KEEPalived配置文件: vim /etc/keep ...
- 【SpringBoot】前缀树 Trie 过滤敏感词
1.过滤敏感词 Spring Boot实践,开发社区核心功能 完成过滤敏感词 Trie 名称:Trie也叫做字典树.前缀树(Prefix Tree).单词查找树 特点:查找效率高,消耗内存大 应用:字 ...
- HTML DOM 定义了访问和操作 HTML 文档标准
HTML DOM 定义了访问和操作 HTML 文档的标准. 您应该具备的基础知识 在您继续学习之前,您需要对以下内容拥有基本的了解: HTML CSS JavaScript 如果您需要首先学习这些项目 ...