title: Could not resolve placeholder List of Custom objects in string value
body: <p>I am unable to read the list of custom objects like below in spring rest controller. But, able to read/fetch the data by autowiring bean into java bean in restcontoller. 
  Can anybody help me in read the list of data from rest controller using annonation @value ?</p>
  
  <p>Could not resolve placeholder List of Custom objects (royalty.testRates) in string value "${royalty.testRates}".</p>
  
  <p>Code snippet for YAML file :</p>
  
  <pre><code>testRates:
      - channelType: "WEB"
        value: "0.03"
      - channelType: "ANDROID_TAB"
        value: "0.04"
      - channelType: "ANDROID_PHONE"
        value: "0.04"
  </code></pre>
  
  <p>Code snippet for java file :
  Java Bean  :</p>
  
  <pre><code>@EnableAsync
  @Configuration
  @EnableConfigurationProperties
  @ConfigurationProperties(ignoreInvalidFields = false, prefix = "royalty")
  @Component
  public class RoyaltyMigration {
  
  private List&lt;TestRate&gt; testRates = new ArrayList&lt;TestRate&gt;();
  
  public static class TestRate {
      private String channelType;
      private String value;
  
      public List&lt;TestRate&gt; getTestRates() {
      return testRates;
      }
  
      public void setTestRates(List&lt;TestRate&gt; testRates) {
      this.testRates = testRates;
      }
  
      public String getChannelType() {
          return channelType;
      }
  
      public void setChannelType(String channelType) {
          this.channelType = channelType;
      }
  
      public String getValue() {
          return value;
      }
  
      public void setValue(String value) {
          this.value = value;
      }
  
  }
  </code></pre>
  
  <p>Spring Rest Controller :</p>
  
  <pre><code>//@Autowired//Commented
  //RoyaltyMigration royaltyMigration;  //Commented
  
  @Value("${royalty.testRates}")
  private List&lt;RoyaltyMigration.TestRate&gt; testRates;//= new ArrayList&lt;RoyaltyMigration.TestRate&gt;();;
  
  public void setTestRates(List&lt;RoyaltyMigration.TestRate&gt; testRates) {
      this.testRates = testRates;
  }
  @RequestMapping(value = "/testrates", method = {RequestMethod.GET, RequestMethod.POST},
          produces = "application/json")
  public ResponseEntity&lt;RoyaltyMigration&gt; testRates() {
      final RoyaltyMigration royaltyMigration = new RoyaltyMigration();
      royaltyMigration.setTestRates(this.testRates);
      return new ResponseEntity&lt;&gt;(royaltyMigration, HttpStatus.OK);
  }
  </code></pre>
  
  <p>Log trace here –</p>
  
  <pre><code>2017-04-02 21:38:46,366 [main] org.springframework.boot.SpringApplication ERROR Application startup failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'royaltyMigrationController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.List com.royalty.controller.RoyaltyMigrationController.testRates; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'royalty.testRates' in string value "${royalty.testRates}"
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:760)
      at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:360)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:306)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)
      at com.expedia.www.host.loyalty.Starter.main(Starter.java:23)
  Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.List com.royalty.controller.LoyaltyMigrationController.testRates; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'loyalty.testRates' in string value "${royalty.testRates}"
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)
      at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
      ... 17 more
  Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'royalty.testRates' in string value "${royalty.testRates}"
      at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174)
      at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
      at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:204)
      at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:178)
      at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$2.resolveStringValue(PropertySourcesPlaceholderConfigurer.java:172)
      at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:808)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1027)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545)
      ... 19 more
  </code></pre>