title: BeanPostProcessor methods are not getting invoked
body: <p>I am trying to understand the sequence of static initialization, instance initialization, InitializingBean and BeanPostProcessor, so I created below example, everything is working except that BeanPostProcessor are not getting invoked, am I missing something?</p>
  
  <pre><code>import org.springframework.beans.factory.BeanFactory;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.beans.factory.xml.XmlBeanFactory;
  import org.springframework.context.ApplicationContext;
  import org.springframework.context.support.FileSystemXmlApplicationContext;
  import org.springframework.core.io.FileSystemResource;
  import org.springframework.stereotype.Component;
  
  @Component
  public class SpringTest {
  
      @Autowired
      Person person;
  
      public static void main(String[] args) {
          testApplicationContext();
      }
  
      private static void testApplicationContext() {
          // here static and instance initializers of Person class will be invoked right away, even when we are not calling getBean method
          ApplicationContext applicationContext = new FileSystemXmlApplicationContext("C:\\E_Drive\\Projects\\Workspace\\Test\\CS101\\src\\com\\learn\\stackoverflow\\general\\bean.xml");
          ApplicationContext applicationContext2 = new FileSystemXmlApplicationContext("C:\\E_Drive\\Projects\\Workspace\\Test\\CS101\\src\\com\\learn\\stackoverflow\\general\\bean.xml");
  
          // notice that above you are creating 2 ioc containers, and since they are different ioc containers so it is possible to have 2 singletons in JVM.
  
          SpringTest springTest = (SpringTest) applicationContext.getBean("springTest");
  
      }
  
  
  }
  </code></pre>
  
  <p>Person class:</p>
  
  <pre><code>import org.springframework.beans.BeansException;
  import org.springframework.beans.factory.InitializingBean;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.beans.factory.config.BeanPostProcessor;
  import org.springframework.context.annotation.Scope;
  import org.springframework.stereotype.Component;
  
  @Component
  @Scope(value="singleton")
  public class Person implements InitializingBean, BeanPostProcessor {
      @Autowired
      SpringTest springTest;
  
      static{
          System.out.println("Static initialization");
      }
  
      {
          System.out.println("Instance initialization");
      }
  
      public void sayHello(){
          System.out.println("Hello");
      }
  
      @Override
      public void afterPropertiesSet() throws Exception {
          System.out.println("InitializingBean.afterPropertiesSet");
      }
  
      @Override
      public Object postProcessAfterInitialization(Object arg0, String arg1) throws BeansException {
          System.out.println("BeanPostProcessor.postProcessAfterInitialization : " + arg1);
          return arg0;
      }
  
      @Override
      public Object postProcessBeforeInitialization(Object arg0, String arg1) throws BeansException {
          System.out.println("BeanPostProcessor.postProcessBeforeInitialization : " + arg1);
          return arg0;
      }
  
  }
  </code></pre>
  
  <p>Bean XML file:    </p>
  
  <pre><code>&lt;beans xmlns = "http://www.springframework.org/schema/beans"
     xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
     xmlns:context="http://www.springframework.org/schema/context"
     xsi:schemaLocation = "http://www.springframework.org/schema/beans
     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context
         http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
      &lt;context:component-scan base-package="com.learn.stackoverflow.general"/&gt;
      &lt;context:annotation-config /&gt;
  
     &lt;!-- &lt;bean id = "person" class = "com.learn.stackoverflow.general.Person" scope="singleton"&gt;
     &lt;/bean&gt; --&gt;
  
     &lt;bean id = "springTest" class = "com.learn.stackoverflow.general.SpringTest" scope="singleton"&gt;
     &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Static initialization
  Instance initialization
  InitializingBean.afterPropertiesSet
  Instance initialization
  InitializingBean.afterPropertiesSet
  </code></pre>
  
  <p>Is there anything else required for BeanPostProcessor methods to be invoked?</p>