title: Why the scope prototype is not working for the spring bean which implements BeanPostProcessor
body: <p>I have a <strong>Bean</strong> which <code>implements</code> <code>BeanPostProcessor</code> </p>
  
  <pre><code>public class ScopeTest implements BeanPostProcessor {
  
      public ScopeTest() {
          System.out.println("ScopeTest()");
      }
  
      public Object postProcessBeforeInitialization(Object bean, String beanName)
              throws BeansException {
          System.out.println("postProcessBeforeInitialization()");
          return null;
      }
  
      public Object postProcessAfterInitialization(Object bean, String beanName)
              throws BeansException {
          System.out.println("postProcessAfterInitialization()");
          return null;
      }
  }
  </code></pre>
  
  <p>and I have configured it in Spring bean configuration file with <code>scope</code> as <code>prototype</code>.</p>
  
  <pre><code>&lt;bean id="st" class="com.test.ScopeTest" scope="prototype" /&gt;
  </code></pre>
  
  <p>and I run the code using <code>ApplicationContext</code> </p>
  
  <pre><code>public class App {
      public static void main(String[] args) {
          ApplicationContext container = new ClassPathXmlApplicationContext("spring.xml");
      }
  }
  </code></pre>
  
  <p>and the output I observed is</p>
  
  <pre><code>ScopeTest()
  </code></pre>
  
  <p>Here what makes the container to create the object for the bean which is marked as <code>prototype</code> without <code>getBean()</code>?</p>