SpringBoot的启动过程。我们可以看出一个SpringBoot。入口为SpringApplication.run方法,
第二步,根据RepositoryConfigurationDelegate读取配置文件信息。初始化配置。
第三步,o.s.cloud.context.scope.GenericScope 根据配置文件信息创建bean工厂。
第四步, trationDelegate$BeanPostProcessorChecker检查bean创建是否合法。
第五步,o.s.b.w.embedded.tomcat.TomcatWebServe初始化springboot内置Tomcat容器。
第六步,w.s.c.ServletWebServerApplicationContext 创建Servlet
第七步,c.c.f.a.s.a.SpringValueProcessor 开启可访问镜像。
以下是一个springboot的加载输出日志:
2022-10-19 10:18:04.370 INFO 30268 --- [ main] cn.xxx.xxx.MXXXBusinessApplication : No active profile set, falling back to default profiles: default
2022-10-19 10:18:06.598 INFO 30268 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2022-10-19 10:18:06.603 INFO 30268 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2022-10-19 10:18:06.673 INFO 30268 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 45 ms. Found 0 Redis repository interfaces.
2022-10-19 10:18:07.116 INFO 30268 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=5eafe63c-6cce-367c-afac-7da202182c04
2022-10-19 10:18:07.930 INFO 30268 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration' of type [org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-10-19 10:18:07.934 INFO 30268 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration$ReactorDeferringLoadBalancerFilterConfig' of type [org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration$ReactorDeferringLoadBalancerFilterConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-10-19 10:18:07.936 INFO 30268 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'reactorDeferringLoadBalancerExchangeFilterFunction' of type [org.springframework.cloud.client.loadbalancer.reactive.DeferringLoadBalancerExchangeFilterFunction] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-10-19 10:18:08.842 INFO 30268 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8302 (http)
2022-10-19 10:18:08.856 INFO 30268 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-10-19 10:18:08.857 INFO 30268 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.48]
2022-10-19 10:18:09.048 INFO 30268 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-10-19 10:18:09.048 INFO 30268 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4631 ms
2022-10-19 10:18:10.574 INFO 30268 --- [ main] c.c.f.a.s.a.SpringValueProcessor : Monitoring key: keys.RSAPublicKey, beanName: userTokenUtils, method: cn.ctg.common.util.UserTokenUtils.setRasPublicKey
2022-10-19 10:18:10.574 INFO 30268 --- [ main] c.c.f.a.s.a.SpringValueProcessor : Monitoring key: keys.RSAPrivateKey, beanName: userTokenUtils, method: cn.ctg.common.util.UserTokenUtils.setRasPrivateKey
2022-10-19 10:18:10.575 INFO 30268 --- [ main] c.c.f.a.s.a.SpringValueProcessor : Monitoring key: keys.aeskey, beanName: userTokenUtils, method: cn.ctg.common.util.UserTokenUtils.setAesKey