Spring Web 应用启动日志分析 - 加载组件和配置文件
这段日志记录了一个 Spring Web 应用程序的启动过程,其中包含以下关键步骤:
-
加载和刷新应用程序上下文:
14:38:02.872 [RMI TCP Connection(3)-127.0.0.1] INFO o.s.web.context.ContextLoader - Root WebApplicationContext: initialization started:表示 Root WebApplicationContext 的初始化开始。14:38:02.934 [RMI TCP Connection(3)-127.0.0.1] DEBUG o.s.w.c.s.XmlWebApplicationContext - Refreshing Root WebApplicationContext:表示正在刷新 Root WebApplicationContext。
-
扫描类路径中的候选组件类:
14:38:03.132 [RMI TCP Connection(3)-127.0.0.1] DEBUG o.s.c.a.ClassPathBeanDefinitionScanner - Identified candidate component class: file [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\StudentInfo_war\WEB-INF\classes\net\fuzui\StudentInfo\service\impl\AdminServiceImpl.class]:表示扫描到一个候选组件类AdminServiceImpl。- 同样,日志中还记录了其他组件类的扫描结果,例如
CoursePlanServiceImpl、CourseServiceImpl、GradeServiceImpl、SelectCourseServiceImpl、StudentServiceImpl和TeacherServiceImpl。
-
加载 Spring 配置文件中的 Bean 定义:
14:38:03.156 [RMI TCP Connection(3)-127.0.0.1] DEBUG o.s.b.f.xml.XmlBeanDefinitionReader - Loaded 18 bean definitions from class path resource [config/spring/applicationContext.xml]:表示从config/spring/applicationContext.xml文件中加载了 18 个 Bean 定义。
这段日志展示了 Spring Web 应用程序启动时的一系列关键步骤,包括加载和配置应用程序上下文、扫描和注册组件类,以及加载 Bean 定义。这些步骤确保应用程序能够正常启动并运行。
原文地址: https://www.cveoy.top/t/topic/oCnV 著作权归作者所有。请勿转载和采集!