I have a spring boot webapplication with a angular frontend. When i send a request using the angular app while the webapplication is still starting up it may occur that the webapplication can accept that request and will try processing it. I believe the application is capable of receiving requests the moment that the WebSecurityConfigurerAdapter extending class has been initialized.
This causes problems when the rest of the classes have yet to fully initialize. For instance, when i try to log out a user that is still logged in while the webapplication is starting up, it may cause a SQLException because it can't find the database table user yet.
How do i prevent the application from accepting requests until the final class (the one annotated with @SpringBootApplication) has been initialized?