title: Spring property placeholders in application-context.xml inside dependency jar
body: <p>For my spring boot application I use annotation based configuration and a <code>WebApplicationInitalizer</code>. </p>
  
  <p>One of my dependencies provides a spring configuration in an xml, included in the jar. I use <code>@ImportResource</code> to load the context xml. This seems to work, except for the fact that inside this xml, there are property placeholders, for example <code>${poolsize:10}</code></p>
  
  <p>Apparently, spring does not automatically replace these placeholders (I get a <code>NumberFormatException</code>). Is there some extra configuration I need to add?</p>
  
  <p>Our startup class:</p>
  
  <pre><code>public class Application implements WebApplicationInitializer {
  
      @Override
      public void onStartup(ServletContext container) throws ServletException {
          // Create the 'root' Spring application context
          AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
  
          // config
          rootContext.register(JmsConfiguration.class);
  
          // Manage the lifecycle of the root application context
          container.addListener(new ContextLoaderListener(rootContext));
      }
  
  }
  </code></pre>
  
  <p>And the configuration class (we use spring-jms):</p>
  
  <pre><code>@Configuration
  @EnableJms
  @ComponentScan(basePackages = { "..." })
  public class JmsConfiguration implements JmsListenerConfigurer {
         // config for jms listener and jaxb, nothing to do with property handling
  }
  </code></pre>
  
  <p>Perhaps I'm mistaken in thinking that using a WebapplicationInitializer is how to use spring boot. Perhaps we don't even need spring boot?  The only spring boot related dependency we use is:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;!-- Import dependency management from Spring Boot --&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-dependencies&lt;/artifactId&gt;
      &lt;version&gt;1.5.3.RELEASE&lt;/version&gt;
      &lt;type&gt;pom&lt;/type&gt;
      &lt;scope&gt;import&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Spring dependencies we use:</p>
  
  <pre><code>org.springframework:spring-context:jar:4.3.8.RELEASE:compile
  org.springframework:spring-jms:jar:4.3.8.RELEASE:compile
  org.springframework:spring-oxm:jar:4.3.8.RELEASE:compile
  org.springframework:spring-context:jar:4.3.8.RELEASE:compile
  org.springframework:spring-beans:jar:4.3.8.RELEASE:compile
  </code></pre>