title: How to call BeanFactoryPostProcessor.postProcessBeanFactory method when use Spring with XML configuration file?
body: <p>I have a configuration file <code>beans.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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.1.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context-3.1.xsd
          "&gt;
  
  
      &lt;bean id="myBeanFactoryPostProcessor" class="com.ssll.MyBeanFactoryPostProcessor" /&gt;
  
      &lt;bean id="myobj" class="com.ssll.MyFoo"&gt;
              &lt;property name="realname" value="${dummy}" /&gt;
       &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>Here, <code>com.ssll.MyBeanFactoryPostProcessor</code> is a class:</p>
  
  <pre><code>public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {  
  
      @Override
      public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {  
          System.out.println("This is expected to called when the BeanFactory is created");  
  
          Properties p  = Config.getZooProperties();
          PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
          cfg.setProperties(p);
          cfg.postProcessBeanFactory(beanFactory);     
      }  
  
  }  
  </code></pre>
  
  <p>But the <code>postProcessBeanFactory</code> is never called, where I am wrong, please
  help.</p>
  
  <p>I made a small test project here <a href="https://github.com/yujiaao/spring4test" rel="nofollow noreferrer">https://github.com/yujiaao/spring4test</a></p>