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);
UserLibrary is a third-party utility that I use in my application. The above code generates a warning for the variable "context". The warning is shown below:
Resource leak: 'context' is never closed
I do not understand the warning. Since the application is a spring MVC application, I cannot really close / destroy the context as I access the service while the application is running. What exactly is the warning trying to tell me?
java spring eclipse spring-mvc
ziggy Jan 06 '13 at 16:17 2013-01-06 16:17
source share