advancedSpring Boot Internals

What happens internally during the Spring Boot application startup lifecycle?

SpringApplication.run() first prepares the Environment (property sources, active profiles), creates the appropriate ApplicationContext type, and invokes any registered ApplicationContextInitializers. It then calls context.refresh(), which loads all bean definitions, runs BeanFactoryPostProcessors, registers BeanPostProcessors, instantiates every singleton bean (triggering auto-configuration's conditional evaluation along the way), and publishes a ContextRefreshedEvent — finally, any ApplicationRunner/CommandLineRunner beans execute before the application is considered fully started.

This is a Pro question

Sign in, then upgrade to Pro or Power to unlock this question and the full Interview Prep bank.

What happens internally during the Spring Boot application startup lifecycle?

Next Step

Continue to What's the difference between ApplicationContextInitializer, ApplicationRunner, and CommandLineRunner?← Back to all Spring Boot & Microservices questions