1 Star 0 Fork 0

fiercetiger/laboratory

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

applicationcontext-test

介绍

了解一下 HierarchicalBeanFactory,spring applicationcontext可以分层级的,可以把框架的applicationcontext跟应用的applicationcontext 隔开

一个普通类就能干趴你的springboot,你信吗?

see blog with url https://www.cnblogs.com/rongdi/p/11780204.html in cnblogs

run the demo code cause an error flow

2019-11-04 23:59:45.705  INFO 6252 --- [           main] c.f.applicationcontext_test.App          : No active profile set, falling back to default profiles: default
2019-11-04 23:59:46.478  WARN 6252 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'methodValidationPostProcessor' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Unsatisfied dependency expressed through method 'methodValidationPostProcessor' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.core.env.Environment' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
2019-11-04 23:59:46.487  INFO 6252 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-11-04 23:59:46.619 ERROR 6252 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method methodValidationPostProcessor in org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration required a bean of type 'org.springframework.core.env.Environment' that could not be found.


Action:

Consider defining a bean of type 'org.springframework.core.env.Environment' in your configuration.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/fiercetiger/laboratory.git
git@gitee.com:fiercetiger/laboratory.git
fiercetiger
laboratory
laboratory
master

搜索帮助