You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@SpringBootApplication
public class ExampleServletInitializer extends SpringBootServletInitializer {
public static void main(String[] args) {
ConfigurableApplicationContext app = SpringApplication.run(ExampleServletInitializer.class, args);
Test test = app.getAutowireCapableBeanFactory().createBean(Test.class);
System.out.println(app.getBeanNamesForType(Test.class).length);
}
}
If you have a Spring Boot app
and a class in the same package
Then on startup:
prints
However, if you add a method to the
Test
class, log showsNow when you rerun
System.out.println(app.getBeanNamesForType(Test.class).length);
, you getand things no longer work as expected.
The text was updated successfully, but these errors were encountered: