Spring Boot——[java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration]解决方案
问题描述
问题分析
没在根目录下写一个Spring Boot的启动类。
解决方案
方案一:Class
在根目录下写一个Spring Boot的启动类。
方案二:注解
需要在注解上加上
@SpringBootTest(classes = Application.class)
或者
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {JPAConfig.class})
或者
@RunWith(SpringRunner.class)
@ContextConfiguration(classes = {JPAConfig.class})
或者
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(value={"myJPAConfig.xml"})
或者
@RunWith(SpringRunner.class)
@ContextConfiguration(value={"myJPAConfig.xml"})
参考文章
https://blog.csdn.net/csdn_am/article/details/79757097
https://blog.csdn.net/rhb99999/article/details/73550860
https://blog.csdn.net/weixin_39220472/article/details/80206449
Spring Boot——[java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration]解决方案相关推荐
- java.lang.IllegalStateException Unable to find a @SpringBootConfiguration错误解决方案(亲测)
问题描述: java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @C ...
- spring boot:java.lang.IllegalStateException异常
1.单元测试报错: java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]. Specify @B ...
- java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Contex
报这个错,是因为测试包名和项目包名不一致导致的.
- java.lang.IllegalStateException: Unable to read meta-data for class 问题的解决
java.lang.IllegalStateException: Unable to read meta-data for class 问题的解决 参考文章: (1)java.lang.Illegal ...
- SpringBootTest测试类报错:Suppressed: java.lang.IllegalStateException: Unable to find a @SpringBootCon
在一个特别简单的mybatisPlus测试类中,单元测试时,报错Suppressed: java.lang.IllegalStateException: Unable to find a @Sprin ...
- spring异常java.lang.IllegalStateException
十月 26, 2017 11:23:24 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler [&q ...
- SSM 之 java.lang.IllegalStateException: Failed to load ApplicationContext 错误解决方案
SSM框架搭建后台项目,为了便于接口开发测试,笔者在项目中使用了Junit测试用例来测试接口,在测试运行后,出现如下错误: java.lang.IllegalStateException: Faile ...
- java.lang.RuntimeException: Unable to start activity ComponentInfo解决方案
java.lang.RuntimeException:Unable to start activityComponentInfo{com.example.newsreader/com.example. ...
- Spring 测试运行的时候提示 Unable to find a @SpringBootConfiguration 错误
Spring 进行测试的时候提示的错误信息如下: SEVERE: Caught exception while closing extension context: org.junit.jupiter ...
最新文章
- Linux学习笔记之文件管理和目录管理类命令
- Java对象序列化详解6,Java对象的序列化与反序列化详解
- bzoj3270 博物馆
- 深度学习网络backbone?head、neck、bottleneck、GAP、Embedding、pretext task、downstream task、temperature parameter
- Docker存储和虚拟化存储需求不同
- 【资讯】CloudBase Framework工具推荐:前后端一体化部署,效能提升开源“神器”
- Spring Cloud基础教程
- [vue] 怎么访问到子组件的实例或者子元素?
- 自动生成三层结构代码(2)--生成实体类
- 挂服务器刷屏微信,谁知道微信群刷屏代码啊,跪求
- tensorflow之 feature_column + pre-made estimator组合实战
- .net C#实现图像对比
- 硬见小百科:机加工中获得工件尺寸精度的常用方法
- 【毕业设计】STM32智能药箱系统 - 单片机 嵌入式 物联网
- 电力监控服务器维修,地铁电力监控系统(PSCADA)发生故障应该如何处理
- 上海黄山自游二日游攻略
- ECSHOP二次开发帮助之全部程序文件说明
- 3种重新启动或强制关闭任何Mac死机的方法
- 数据分析师需要学习什么课程?
- Android Studio:使用SVN进行版本控制
热门文章
- java max sum_杭电1024 Max Sum Plus Plus状压dp(java)
- linux命令拉取windows的文件,find命令、文件名后缀以及Linux和Windows互传文件(示例代码)...
- openstack 重启mysql_突然断电导致mariadb数据库无法启动(openstack 命令无法使用)...
- springboot 前缀_SpringBoot配置文件的注入
- 怎样自动提取邮件的内容_流程自动化和人工智能如何创建智慧物流?
- Collections.sort()泛型集合排序的使用,和自定义类实现Comparable<T>接口重写compareTo(T o)方法完成Collections.sort()排序,以及自定义排序规则
- Java受查异常和运行时异常的理解
- linux空指针异常能捕获到吗,一次kernel panic分析--空指针in handle_IRQ_event
- java过滤4字节_乐字节Java8核心特性实战之四:方法引用
- mysql 热切换_热备服务器中,切换master中切换SQL