In a spring MVC application, I initialize a variable in one of the service classes using the following approach:
ApplicationContext context = new C
A simple cast solves the issue:
((ClassPathXmlApplicationContext) fac).close();