Spring-Boot @Autowired in main class is getting null
onStartup is called by the servlet container very early in your application’s lifecycle and is called on an instance of the class that was created by the servlet container, not Spring Boot. This is why jmsTopicListener is null. Rather than overriding onStartup you could use a method annotated with @PostConstruct. It will be called by … Read more