Spring Boot - Spring Annotations
Given this Spring Boot bean code:
When running the application, the developer notices that "Cleanup resources" is never printed on shutdown. What is the most likely cause?
public class ResourceBean {
@PostConstruct
public void setup() {
System.out.println("Setup resources");
}
@PreDestroy
public void cleanup() {
System.out.println("Cleanup resources");
}
public void start() {
System.out.println("Start method called");
}
}When running the application, the developer notices that "Cleanup resources" is never printed on shutdown. What is the most likely cause?
