title: Spring init and destroy methods
body: <pre><code>package com.idol;
  
  public class Auditorium {       
  Auditorium(){
  }  
  public void turnOnLights() {  
      System.out.println("Lights are turned on"); 
  }  
  public void turnOffLights(){  
      System.out.println("Lights are turned off");
  }  
  </code></pre>
  
  <p>}</p>
  
  <p>For xml context I have:</p>
  
  <pre><code> &lt;bean id="Auditorium" class="com.idol.Auditorium" init-method="turnOnLights" destroy-method="turnOffLights"/&gt;
  </code></pre>
  
  <p>Testing:</p>
  
  <pre><code>ApplicationContext auditorium =
          new ClassPathXmlApplicationContext("ApplicationContextVer6.xml"); 
  
  auditorium.getBean("Auditorium");
  </code></pre>
  
  <p>I get:</p>
  
  <p><strong>Does only print "Lights are turned on" and doesn't print "Lights are turned off". I though that before destroying the bean it should invoke the destroy-method too, what am I missing or not getting? (I have no errors in log, just in case)</strong></p>
  
  <p>Thanks</p>