所以,我不知道为什么要对我发表评论
((ConfigurableApplicationContext)applicationContext).close();
在
init(ServletConfig config)这样
@Overridepublic void init(ServletConfig config) throws ServletException { super.init(config); ApplicationContext applicationContext = new ClassPathXmlApplicationContext("/appServlet/servlet-context.xml"); this.restaurantOwnerRepository = (RestauranOwnerDAO)applicationContext.getBean("restaurantOwnerRepository"); //((ConfigurableApplicationContext)applicationContext).close();}但 没有关闭 应用程序上下文肯定在这里有所帮助。
我没想到 我只是遵循Eclipse中的警告
Resource leak: 'applicationContext' is never closed
并没有明显地思考就关闭了它。



