title: Spring boot could not resolve placeholder in string
body: <p>I am running spring-boot on an embedded tomcat server through maven with <code>mvn clean install spring-boot:run</code>. But every time I run it I get this error:</p>
  
  <pre><code> Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'language' in string value "${language}"
      at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174) ~[spring-core-4.3.6.RELEASE.jar:4.3.6.RELEASE]
      at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) ~[spring-core-4.3.6.RELEASE.jar:4.3.6.RELEASE]
      at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:236) ~[spring-core-4.3.6.RELEASE.jar:4.3.6.RELEASE]
      at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210) ~[spring-core-4.3.6.RELEASE.jar:4.3.6.RELEASE]
      at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$2.resolveStringValue(PropertySourcesPlaceholderConfigurer.java:172) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:831) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1086) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
      at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
      ... 35 common frames omitted
  </code></pre>
  
  <p>That error is regarding these two lines of code: </p>
  
  <pre><code>@Value("${language}")
  private String language;
  </code></pre>
  
  <p>That language flag is specified in my application.properties like this: </p>
  
  <p><em>application.properties</em></p>
  
  <pre><code>language=java
  logging.level.org.springframework=TRACE
  </code></pre>
  
  <p><strong>This is the confusing part:</strong> When I run the build without the <em>spring-boot:run</em> command, it builds properly and I can run the built jar with no issues at all. It is only when I try to run on the embedded tomcat server I run into this issue. </p>
  
  <p>I can sort of bypass this by doing this in my code: </p>
  
  <pre><code>@Value("${language:java}")
  private String language;
  </code></pre>
  
  <p>But that doesn't make sense to me since spring is supposed to read the default value from the <code>application.properties</code> file automatically. </p>
  
  <p><strong>EDIT</strong>: as people have pointed out, it is not reading <code>application.properties</code> at all when run on the embedded tomcat server. Any way to force it to read the file or a reason why it may not be reading it? It works fine when deployed to an external app server instead of the embedded one. </p>
  
  <p>Thanks in advance for your help. </p>