创建SpringApplication阶段

  • 保存当前主启动类信息class com.atguigu.boot.Boot09HelloTestApplication
  • 使用工具类ClassUtils判定当前应用的类型。一般是Servlet类型
  • bootstrappers:初始启动引导器(List):去spring.factories文件中找 org.springframework.boot.Bootstrapper
  • ApplicationContextInitializer;去spring.factories找 ApplicationContextInitializer
    • List> initializers
  • ApplicationListener ;应用监听器。spring.factories找 ApplicationListener

    • List> listeners

      运行 SpringApplication阶段

  • StopWatch记录应用的启动时间

  • 创建引导上下文(Context环境)createBootstrapContext()
    • 获取到所有之前的 bootstrappers 挨个执行 intitialize() 来完成对引导启动器上下文环境设置
  • 让当前应用进入headless模式。java.awt.headless
  • 获取所有 RunListener(运行监听器)【为了方便所有Listener进行事件感知】
    • getSpringFactoriesInstances 去spring.factories找 SpringApplicationRunListener.
  • 遍历 SpringApplicationRunListener 调用 starting 方法;
    • 相当于通知所有感兴趣系统正在启动过程的人,项目正在 starting。
  • 保存命令行参数;ApplicationArguments
  • 准备环境 prepareEnvironment();
    • 返回或者创建基础环境信息对象。StandardServletEnvironment
    • 读取所有的配置源的配置属性值。得到所有的PropertySources,@PropertySources即加载外部所有的配置文件xxx.properties
    • 配置激活环境Profile信息,configureProfiles(environment, args);
    • 监听器调用 listener.environmentPrepared();通知所有的监听器当前环境准备完成
  • 创建IOC容器(createApplicationContext())
    • 根据项目类型(Servlet)创建容器,
    • 当前会创建 AnnotationConfigServletWebServerApplicationContext
  • 准备ApplicationContext IOC容器的基本信息 prepareContext()
    • 保存环境信息
    • IOC容器的后置处理流程。
    • 应用初始化器;applyInitializers;
  • 遍历所有的 ApplicationContextInitializer 。调用 initialize.。来对ioc容器进行初始化扩展功能
  • 遍历所有的 listener 调用 contextPrepared。EventPublishRunListenr;通知所有的监听器contextPrepared
    • 所有的监听器 调用 contextLoaded。通知所有的监听器 contextLoaded;
  • 刷新IOC容器。refreshContext【核心源码】
    • 创建容器中的所有组件(Spring注解)
  • 容器刷新完成后工作?afterRefresh
  • 所有监听 器 调用 listeners.started(context); 通知所有的监听器 started
  • 调用所有runners;callRunners()
    • 获取容器中的ApplicationRunner
    • 获取容器中的 CommandLineRunner
    • 合并所有runner并且按照@Order进行排序
    • 遍历所有的runner。先ApplicationRunner 后CommandLineRunner调用 run 方法
  • 如果以上有异常,
    • 调用Listener 的 failed
  • 调用所有监听器的 running 方法 listeners.running(context); 通知所有的监听器 running
  • running如果有问题。继续通知 failed 。调用所有 Listener 的 failed;通知所有的监听器 failed

    测试监控springboot启动的各个环节

    以下黄颜色的5个组件就是我们要监控的组件:

  • ApplicationContextInitializer

  • ApplicationListener
  • SpringApplicationRunListener
  • ApplicationRunner
  • CommandLineRunner

image.png
其中需要注意MyApplicationContextInitializer、MyApplicationListener、MySpringApplicationRunListener这三个不需要加上加上@Component,但需要配到自己的**spring.factories**里面:配置成我们的对象

  1. com.atguigu.boot.listener.MyApplicationContextInitializer
  2. com.atguigu.boot.listener.MyApplicationListener
  3. com.atguigu.boot.listener.MySpringApplicationRunListener

image.png
剩下两个MyApplicationRunnerMyCommandLineRunner不用配置到**spring.factories**
因为获取容器中的ApplicationRunner ,获取容器中的 CommandLineRunner
加上@Component,加上@Component即可

调用所有runners;callRunners() 获取容器中的ApplicationRunner 获取容器中的 CommandLineRunner 合并所有runner并且按照@Order进行排序 遍历所有的runner。先ApplicationRunner 后CommandLineRunner调用 run 方法

MyApplicationContextInitializer

  1. package com.atguigu.boot.listener;
  2. import org.springframework.context.ApplicationContextInitializer;
  3. import org.springframework.context.ConfigurableApplicationContext;
  4. public class MyApplicationContextInitializer implements ApplicationContextInitializer {
  5. @Override
  6. public void initialize(ConfigurableApplicationContext applicationContext) {
  7. System.out.println("MyApplicationContextInitializer ....initialize.... ");
  8. }
  9. }

MyApplicationListener

  1. package com.atguigu.boot.listener;
  2. import org.springframework.context.ApplicationEvent;
  3. import org.springframework.context.ApplicationListener;
  4. public class MyApplicationListener implements ApplicationListener {
  5. @Override
  6. public void onApplicationEvent(ApplicationEvent event) {
  7. System.out.println("MyApplicationListener.....onApplicationEvent...");
  8. }
  9. }

MySpringApplicationRunListener

这些方法代表我们监听的Spring的一些操作状态

  • 既能监听到做一些打印信息
  • 也可以拿到具体状态阶段创建或者更新的对象(方法参数),这是个回调机制 ```java package com.atguigu.boot.listener;

import org.springframework.boot.ConfigurableBootstrapContext; import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplicationRunListener; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.core.env.ConfigurableEnvironment;

public class MySpringApplicationRunListener implements SpringApplicationRunListener {

  1. private SpringApplication application;
  2. public MySpringApplicationRunListener(SpringApplication application, String[] args){
  3. this.application = application;
  4. }
  5. @Override
  6. public void starting(ConfigurableBootstrapContext bootstrapContext) {
  7. System.out.println("MySpringApplicationRunListener....starting....");
  8. }
  9. @Override
  10. public void environmentPrepared(ConfigurableBootstrapContext bootstrapContext, ConfigurableEnvironment environment) {
  11. System.out.println("MySpringApplicationRunListener....environmentPrepared....");
  12. }
  13. @Override
  14. public void contextPrepared(ConfigurableApplicationContext context) {
  15. System.out.println("MySpringApplicationRunListener....contextPrepared....");
  16. }
  17. @Override
  18. public void contextLoaded(ConfigurableApplicationContext context) {
  19. System.out.println("MySpringApplicationRunListener....contextLoaded....");
  20. }
  21. @Override
  22. public void started(ConfigurableApplicationContext context) {
  23. System.out.println("MySpringApplicationRunListener....started....");
  24. }
  25. @Override
  26. public void running(ConfigurableApplicationContext context) {
  27. System.out.println("MySpringApplicationRunListener....running....");
  28. }
  29. @Override
  30. public void failed(ConfigurableApplicationContext context, Throwable exception) {
  31. System.out.println("MySpringApplicationRunListener....failed....");
  32. }

}

  1. 注意:若不写构造方法会报错,报错信息如下:
  2. ```java
  3. D:\java8u211\jdk\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always "-javaagent:D:\Program Files\IntelliJ IDEA 2020.3.1\lib\idea_rt.jar=62689:D:\Program Files\IntelliJ IDEA 2020.3.1\bin" -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath D:\java8u211\jdk\jre\lib\charsets.jar;D:\java8u211\jdk\jre\lib\deploy.jar;D:\java8u211\jdk\jre\lib\ext\access-bridge-64.jar;D:\java8u211\jdk\jre\lib\ext\cldrdata.jar;D:\java8u211\jdk\jre\lib\ext\dnsns.jar;D:\java8u211\jdk\jre\lib\ext\jaccess.jar;D:\java8u211\jdk\jre\lib\ext\jfxrt.jar;D:\java8u211\jdk\jre\lib\ext\localedata.jar;D:\java8u211\jdk\jre\lib\ext\nashorn.jar;D:\java8u211\jdk\jre\lib\ext\sunec.jar;D:\java8u211\jdk\jre\lib\ext\sunjce_provider.jar;D:\java8u211\jdk\jre\lib\ext\sunmscapi.jar;D:\java8u211\jdk\jre\lib\ext\sunpkcs11.jar;D:\java8u211\jdk\jre\lib\ext\zipfs.jar;D:\java8u211\jdk\jre\lib\javaws.jar;D:\java8u211\jdk\jre\lib\jce.jar;D:\java8u211\jdk\jre\lib\jfr.jar;D:\java8u211\jdk\jre\lib\jfxswt.jar;D:\java8u211\jdk\jre\lib\jsse.jar;D:\java8u211\jdk\jre\lib\management-agent.jar;D:\java8u211\jdk\jre\lib\plugin.jar;D:\java8u211\jdk\jre\lib\resources.jar;D:\java8u211\jdk\jre\lib\rt.jar;E:\开发教程\springboot2\boot-09-hello-test\target\classes;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot-starter-web\2.4.0\spring-boot-starter-web-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot-starter\2.4.0\spring-boot-starter-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot\2.4.0\spring-boot-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot-autoconfigure\2.4.0\spring-boot-autoconfigure-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot-starter-logging\2.4.0\spring-boot-starter-logging-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\apache\logging\log4j\log4j-to-slf4j\2.13.3\log4j-to-slf4j-2.13.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\apache\logging\log4j\log4j-api\2.13.3\log4j-api-2.13.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\yaml\snakeyaml\1.27\snakeyaml-1.27.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot-starter-json\2.4.0\spring-boot-starter-json-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\com\fasterxml\jackson\core\jackson-databind\2.11.3\jackson-databind-2.11.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\com\fasterxml\jackson\core\jackson-annotations\2.11.3\jackson-annotations-2.11.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\com\fasterxml\jackson\core\jackson-core\2.11.3\jackson-core-2.11.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.11.3\jackson-datatype-jdk8-2.11.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.11.3\jackson-datatype-jsr310-2.11.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.11.3\jackson-module-parameter-names-2.11.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot-starter-tomcat\2.4.0\spring-boot-starter-tomcat-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\apache\tomcat\embed\tomcat-embed-core\9.0.39\tomcat-embed-core-9.0.39.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\glassfish\jakarta.el\3.0.3\jakarta.el-3.0.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.39\tomcat-embed-websocket-9.0.39.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-web\5.3.1\spring-web-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-beans\5.3.1\spring-beans-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-webmvc\5.3.1\spring-webmvc-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-aop\5.3.1\spring-aop-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-context\5.3.1\spring-context-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-expression\5.3.1\spring-expression-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-core\5.3.1\spring-core-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-jcl\5.3.1\spring-jcl-5.3.1.jar;E:\开发教程\springboot2\boot-09-customer-starter\atguigu-hello-spring-boot-starter-autoconfigure\target\classes com.atguigu.boot.Boot09HelloTestApplication
  4. Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.boot.SpringApplicationRunListener : com.atguigu.boot.listener.MySpringApplicationRunListener
  5. at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:467)
  6. at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:449)
  7. at org.springframework.boot.SpringApplication.getRunListeners(SpringApplication.java:437)
  8. at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
  9. at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309)
  10. at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298)
  11. at com.atguigu.boot.Boot09HelloTestApplication.main(Boot09HelloTestApplication.java:10)
  12. Caused by: java.lang.NoSuchMethodException: com.atguigu.boot.listener.MySpringApplicationRunListener.<init>(org.springframework.boot.SpringApplication, [Ljava.lang.String;)
  13. at java.lang.Class.getConstructor0(Class.java:3082)
  14. at java.lang.Class.getDeclaredConstructor(Class.java:2178)
  15. at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:462)
  16. ... 6 more
  17. Process finished with exit code 1

我们看看官方的spring.factoriesSpringApplicationRunListener是怎么写的
image.png
搜一下EventPublishingRunListener发现EventPublishingRunListener写了有参构造器,所以我们模仿EventPublishingRunListener给我们的MySpringApplicationRunListener也添加有参构造器
image.png

  1. //这也指示我们SpringApplicationRunListener会在初始化的时候拿到SpringApplication对象实例
  2. private SpringApplication application;
  3. public MySpringApplicationRunListener(SpringApplication application, String[] args){
  4. this.application = application;
  5. }

MyApplicationRunner

  1. package com.atguigu.boot.listener;
  2. import org.springframework.boot.ApplicationArguments;
  3. import org.springframework.boot.ApplicationRunner;
  4. import org.springframework.core.annotation.Order;
  5. import org.springframework.stereotype.Component;
  6. @Order(1)
  7. @Component
  8. public class MyApplicationRunner implements ApplicationRunner {
  9. @Override
  10. public void run(ApplicationArguments args) throws Exception {
  11. System.out.println("MyApplicationRunner...run...");
  12. }
  13. }

MyCommandLineRunner

  1. package com.atguigu.boot.listener;
  2. import org.springframework.boot.CommandLineRunner;
  3. import org.springframework.core.annotation.Order;
  4. import org.springframework.stereotype.Component;
  5. /**
  6. * 应用启动做一个一次性事情
  7. */
  8. @Order(2)
  9. @Component
  10. public class MyCommandLineRunner implements CommandLineRunner {
  11. @Override
  12. public void run(String... args) throws Exception {
  13. System.out.println("MyCommandLineRunner....run....");
  14. }
  15. }

跑起来看看

  1. D:\java8u211\jdk\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always "-javaagent:D:\Program Files\IntelliJ IDEA 2020.3.1\lib\idea_rt.jar=62824:D:\Program Files\IntelliJ IDEA 2020.3.1\bin" -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath D:\java8u211\jdk\jre\lib\charsets.jar;D:\java8u211\jdk\jre\lib\deploy.jar;D:\java8u211\jdk\jre\lib\ext\access-bridge-64.jar;D:\java8u211\jdk\jre\lib\ext\cldrdata.jar;D:\java8u211\jdk\jre\lib\ext\dnsns.jar;D:\java8u211\jdk\jre\lib\ext\jaccess.jar;D:\java8u211\jdk\jre\lib\ext\jfxrt.jar;D:\java8u211\jdk\jre\lib\ext\localedata.jar;D:\java8u211\jdk\jre\lib\ext\nashorn.jar;D:\java8u211\jdk\jre\lib\ext\sunec.jar;D:\java8u211\jdk\jre\lib\ext\sunjce_provider.jar;D:\java8u211\jdk\jre\lib\ext\sunmscapi.jar;D:\java8u211\jdk\jre\lib\ext\sunpkcs11.jar;D:\java8u211\jdk\jre\lib\ext\zipfs.jar;D:\java8u211\jdk\jre\lib\javaws.jar;D:\java8u211\jdk\jre\lib\jce.jar;D:\java8u211\jdk\jre\lib\jfr.jar;D:\java8u211\jdk\jre\lib\jfxswt.jar;D:\java8u211\jdk\jre\lib\jsse.jar;D:\java8u211\jdk\jre\lib\management-agent.jar;D:\java8u211\jdk\jre\lib\plugin.jar;D:\java8u211\jdk\jre\lib\resources.jar;D:\java8u211\jdk\jre\lib\rt.jar;E:\开发教程\springboot2\boot-09-hello-test\target\classes;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot-starter-web\2.4.0\spring-boot-starter-web-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot-starter\2.4.0\spring-boot-starter-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot\2.4.0\spring-boot-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot-autoconfigure\2.4.0\spring-boot-autoconfigure-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot-starter-logging\2.4.0\spring-boot-starter-logging-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\apache\logging\log4j\log4j-to-slf4j\2.13.3\log4j-to-slf4j-2.13.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\apache\logging\log4j\log4j-api\2.13.3\log4j-api-2.13.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\yaml\snakeyaml\1.27\snakeyaml-1.27.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot-starter-json\2.4.0\spring-boot-starter-json-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\com\fasterxml\jackson\core\jackson-databind\2.11.3\jackson-databind-2.11.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\com\fasterxml\jackson\core\jackson-annotations\2.11.3\jackson-annotations-2.11.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\com\fasterxml\jackson\core\jackson-core\2.11.3\jackson-core-2.11.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.11.3\jackson-datatype-jdk8-2.11.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.11.3\jackson-datatype-jsr310-2.11.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.11.3\jackson-module-parameter-names-2.11.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\boot\spring-boot-starter-tomcat\2.4.0\spring-boot-starter-tomcat-2.4.0.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\apache\tomcat\embed\tomcat-embed-core\9.0.39\tomcat-embed-core-9.0.39.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\glassfish\jakarta.el\3.0.3\jakarta.el-3.0.3.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.39\tomcat-embed-websocket-9.0.39.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-web\5.3.1\spring-web-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-beans\5.3.1\spring-beans-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-webmvc\5.3.1\spring-webmvc-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-aop\5.3.1\spring-aop-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-context\5.3.1\spring-context-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-expression\5.3.1\spring-expression-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-core\5.3.1\spring-core-5.3.1.jar;E:\dev_dir_temp\apache-maven-3.3.9\respository\org\springframework\spring-jcl\5.3.1\spring-jcl-5.3.1.jar;E:\开发教程\springboot2\boot-09-customer-starter\atguigu-hello-spring-boot-starter-autoconfigure\target\classes com.atguigu.boot.Boot09HelloTestApplication
  2. MyApplicationListener.....onApplicationEvent...
  3. MySpringApplicationRunListener....starting....
  4. MyApplicationListener.....onApplicationEvent...
  5. MySpringApplicationRunListener....environmentPrepared....
  6. . ____ _ __ _ _
  7. /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
  8. ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
  9. \\/ ___)| |_)| | | | | || (_| | ) ) ) )
  10. ' |____| .__|_| |_|_| |_\__, | / / / /
  11. =========|_|==============|___/=/_/_/_/
  12. :: Spring Boot :: (v2.4.0)
  13. MyApplicationContextInitializer ....initialize....
  14. MyApplicationListener.....onApplicationEvent...
  15. MySpringApplicationRunListener....contextPrepared....
  16. 2022-05-10 23:17:49.947 INFO 6336 --- [ main] c.a.boot.Boot09HelloTestApplication : Starting Boot09HelloTestApplication using Java 1.8.0_211 on DESKTOP-7OVMAA2 with PID 6336 (E:\开发教程\springboot2\boot-09-hello-test\target\classes started by hasee in E:\开发教程\springboot2)
  17. 2022-05-10 23:17:49.950 INFO 6336 --- [ main] c.a.boot.Boot09HelloTestApplication : No active profile set, falling back to default profiles: default
  18. MyApplicationListener.....onApplicationEvent...
  19. MySpringApplicationRunListener....contextLoaded....
  20. 2022-05-10 23:17:50.473 INFO 6336 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
  21. 2022-05-10 23:17:50.479 INFO 6336 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
  22. 2022-05-10 23:17:50.479 INFO 6336 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.39]
  23. 2022-05-10 23:17:50.528 INFO 6336 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
  24. 2022-05-10 23:17:50.528 INFO 6336 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 544 ms
  25. 2022-05-10 23:17:50.635 INFO 6336 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
  26. 2022-05-10 23:17:50.746 INFO 6336 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
  27. MyApplicationListener.....onApplicationEvent...
  28. MyApplicationListener.....onApplicationEvent...
  29. 2022-05-10 23:17:50.753 INFO 6336 --- [ main] c.a.boot.Boot09HelloTestApplication : Started Boot09HelloTestApplication in 1.041 seconds (JVM running for 1.879)
  30. MyApplicationListener.....onApplicationEvent...
  31. MyApplicationListener.....onApplicationEvent...
  32. MySpringApplicationRunListener....started....
  33. MyApplicationRunner...run...
  34. MyCommandLineRunner....run....
  35. MyApplicationListener.....onApplicationEvent...
  36. MyApplicationListener.....onApplicationEvent...
  37. MySpringApplicationRunListener....running....