title: Spring does not call destroy method of singleton bean if same method is defined on prototype bean
body: <p>So I have a SingletonMessage class like this</p>
  
  <pre><code> public class SingletonMessage {
      private String message;
      public void destroyBean() {
          System.out.println("Destroying bean");
      }
      public void setMessage(String message) {
          this.message = message;
      }
      public String getMessage() {
          return this.message;
      }}
  </code></pre>
  
  <p>and I gave a prototype bean like this</p>
  
  <pre><code>  public class PrototypeMessage {
  
      private String message;
  
      public void setMessage(String message) {
          this.message = message;
      }
      public void destroyBean() {
          System.out.println("Destroying bean");
      }
      public String getMessage() {
          return this.message;
      }}
  </code></pre>
  
  <p>my beans.xml file is like this</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
  default-init-method="initMessage"
  default-destroy-method="destroyBean"&gt;
      &lt;bean id="smessage" class="com.spring.beans.SingletonMessage" scope="singleton"&gt;
          &lt;property name="message" value="Hello World!"/&gt;
      &lt;/bean&gt;
  
      &lt;bean name="pmessage" class="com.spring.beans.PrototypeMessage" scope="prototype"&gt;
          &lt;property name="message" value="Hello"/&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>When I keep the destroyBean method in the class PrototypeMessage then I do not get a Destroying bean on my console. But when I remove it from PrototypeBean and keep it only in SingletonBean then it displays Destroying bean. Does this have anything to do with the fact that Spring container does not handle the lifecycle of a prototype scoped bean</p>