AnnotationConfigApplicationContext@xxxx has not been refreshed yet
使用注解方式来配置JavaConfig类,从而代替XML配置文件时运行报错:
AnnotationConfigApplicationContext@1517365b has not been refreshed yet
原因
- 需要使用注解类配置文件专用的加载类:
AnnotationConfigApplicationContext - 检查创建加载类的时候是否传递了目标配置类的class:
PersonConfig.class
正确写法如下:
@Test
public void test(){AnnotationConfigApplicationContext ac = // 注意格式和类名new AnnotationConfigApplicationContext(PersonConfig.class);Person person = ac.getBean("person", Person.class);System.out.println(person);
}
AnnotationConfigApplicationContext@xxxx has not been refreshed yet相关推荐
- AnnotationConfigApplicationContext ad has not been refreshed yet 错误
在使用spring框架使用IOC获取bean时有时可能会碰到这个错误 AnnotationConfigApplicationContext ad has not been refreshed yet ...
- AnnotationConfigApplicationContext@51016012 has not been refreshed yet
在使用Spring获取Person的实例时出现了未刷新的错误 错误代码 AnnotationConfigApplicationContext applicationContext = new Anno ...
- org.springframework.context.annotation.AnnotationConfigApplicationContext has not been refreshed yet
代码如下(为了演示这个报错): AnnotationConfigApplicationContext annotationConfigApplicationContext = new Annotati ...
- Spring学习中使用javaConfig进行配置时出现 has not been refreshed yet错误
Spring学习中使用javaConfig进行配置时出现 has not been refreshed yet错误 java.lang.IllegalStateException: org.sprin ...
- 全面了解学习Spring
Spring的底层的整体了解 1.Bean的声明周期底层原理 2.依赖注入的底层原理 3.初始化底层原理 4.推断构造方法底层原理 5.AOP底层原理 6.Spring事务的底层原理 Spring的大 ...
- Spring框架(二) 底层架构核心概念解析-四万字你值得一看
本篇文章将对Spring底层的一些概念做一些简单的分析 , 也是为了方便后续在阅读源码的时候更加的方便 BeanDefintion BeanDefintion是一个接口 , 它表示一个Bean的定义 ...
- AnnotationConfigApplicationContext 报错 has not been refreshed yet
Caused by: java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationC ...
- Spring源码深入阅读AnnotationConfigApplicationContext
一直很好奇代码 AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SimpleBe ...
- [WARNING] unable to add QUERY_STRING=XXXX to uwsgi packet, consider increasing buffer size
1. 问题现象 在用 flask uwsgi api 报文发送 GET 请求时,请求参数的 value 值 "XXX" 太长时,会报下面的错误. [WARNING] unable ...
最新文章
- LPC1768基本输入输出GPIO使用
- 360浏览器登录_360安全浏览器12下载-360安全浏览器12最新版下载
- Hadoop之父Doug Cutting
- JavaScript实现在线MD5、SHA、AES、Rabit 、RC4、TripleDES Ripemd160 加密解密工具-toolfk程序员在线工具网...
- python pandas读取excel-python pandas 读取文件 写入文件excel
- Html中如何让超链接a、图片img居中
- 中有冒号 文件路径_用Matlab脚本文件实现Excel文件的合并
- 括弧匹配检验(信息学奥赛一本通-T1354)
- 渗透测试中说的Shell和Webshll到底是什么
- Atitit lucence es solr的各种query 与sql运算符的对比 目录 1.1. 等于运算 TermQuery	1 1.2. 范围运算	1 1.3. 大小运算	1 1.4. Wi
- 考研必备数学公式大全(数学二)(线性代数篇)
- 标准库函数begin和end的使用
- Arduino基础学习
- 计算机 打印 速度慢,处理打印机在打印文件时打印速度过慢的原因
- 串口通信协议简介—学习笔记
- 让最小化安装的CentOS 6.8能够浏览网页
- 在各种裁员的“寒冬”,还应该对年终奖有多少期待?!
- clock_gettime获取系统时间
- 已开源!Flutter 基于分帧渲染的流畅度优化组件 Keframe
- 世界各地的土豆代表吃法