In a spring MVC application, I initialize a variable in one of the service classes using the following approach:
ApplicationContext context =
new ClassPathXmlApplicationContext("META-INF/userLibrary.xml");
service = context.getBean(UserLibrary.class);
The UserLibrary is a 3rd party utility which I am using in my application. The above code generates a warning for the 'context' variable. The warning is shown below:
Resource leak: 'context' is never closed
I don't understand the warning. As the application is a Spring MVC application, I can't really close/destroy the context as I refer to the service while the application is running. What exactly is the warning trying to tell me?