title: java -eclipse-Resource leak: 'appContext' is never closed
body: <p>I create a small bean class in Eclipse. It is working in NetBeans but in Eclipse it says </p>
  
  <blockquote>
    <p>Resource leak: 'appContext' is never closed. </p>
  </blockquote>
  
  <p>I closed it like this <code>appContext.close();</code>
  but it is not working.</p>
  
  <p>//class drawingapplication</p>
  
  <pre><code>import org.springframework.context.ApplicationContext;
  import org.springframework.context.support.ClassPathXmlApplicationContext;
  
  public class drawingapplication {
  
      public static void main(String[] args) {
          ApplicationContext appContext = new ClassPathXmlApplicationContext("spring.xml");
          Triangle triangle =(Triangle) appContext.getBean("triangle");
          triangle.draw();    
      }
  }
  </code></pre>
  
  <p>// class Triangle</p>
  
  <pre><code>package org.spring.javabeans;
  
  public class Triangle {
      public void draw(){
          System.out.println("triangle drawan");
      }
  }
  </code></pre>
  
  <p>//spring.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN""http://www.springframework.org/dtd/spring-beans-2.0.dtd"&gt;
  
  &lt;beans&gt;
      &lt;bean id="triangle" class="org.spring.javabeans.Triangle"/&gt;
  &lt;/beans&gt;
  </code></pre>