After my application finishes I want to close the spring context.
The relevant code has an ApplicationContext reference but I couldn’t find a close method.
Advertisement
Answer
Downcast your ApplicationContext to ConfigurableApplicationContext which defines close() method:
((ConfigurableApplicationContext)appCtx).close();