title: PropertyPlaceholderConfigurer not loading programmatically
body: <p>I have a custom ApplicationContext class where I'm trying to programmatically load a PropertyPlaceholderConfigurer, then use the placeholders in my XML config file.</p>
  
  <p>I've tried three different approaches so far, and each time I get an error like this:</p>
  
  <pre><code>org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '${domain}.testId' is defined
  </code></pre>
  
  <p>What I am doing wrong?</p>
  
  <p><strong>Context class</strong></p>
  
  <pre><code>public class MyApplicationContext extends GenericApplicationContext {
      public MyApplicationContext (String... locations) throws IOException {
  
          // method one
          ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(this);
          scanner.scan("com.my.package");
  
          // method two
          new MyPropertyPlaceholderConfigurer().postProcessBeanFactory(getBeanFactory());
  
          // method three
          getBeanFactory().registerSingleton("propertyPlaceholderConfigurer", new MyPropertyPlaceholderConfigurer());
  
          // load XML config files
          XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(this);
          for (String location : locations) {
              xmlReader.loadBeanDefinitions(location);
          }
      }
  }
  </code></pre>
  
  <p><strong>XML</strong></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:aop="http://www.springframework.org/schema/aop"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
      &lt;bean id="test.testId" class="java.lang.String"&gt;
          &lt;constructor-arg value="this is the test value" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="prod.testId" class="java.lang.String"&gt;
          &lt;constructor-arg value="this is the prod value" /&gt;
      &lt;/bean&gt;
  
      &lt;alias name="${domain}.testId" alias="testId" /&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>Usage</strong></p>
  
  <pre><code>MyApplicationContext context = new MyApplicationContext(
      new String[] { "test.xml" });
  Assert.assertEquals("this is the test value", context.getBean("testId"));
  </code></pre>