title: @Value -> Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'
body: <p>Good day, I'm working on a web application using Spring 4.1.1.RELEASE. All Spring configuration is done with annotations and it works fine except one thing:</p>
  
  <ul>
  <li><p>I have a config.properties file in the project with these lines</p>
  
  <pre><code>cases.caseList.filter=test
  cases.caseList.numberOfCasesPerPage=50
  </code></pre></li>
  <li><p>I have a config class</p>
  
  <pre><code>@Configuration
  @ComponentScan(basePackageClasses={CaseConfig.class})
  @PropertySource(value = "classpath:config.properties")
  public class CasesModuleTestContextConfig { ... }
  </code></pre></li>
  <li><p>And another class</p>
  
  <pre><code>@Component
  public class HttpRequestParamsToPaginationParams extends AbstractConverter&lt;Map&lt;String, String&gt;, PaginationParams&gt; {
  
      @Value("${cases.caseList.filter}")
      private String filter;
  
      @Value("${cases.caseList.numberOfCasesPerPage}")
      private Integer count;
  
      ...
  }
  </code></pre></li>
  </ul>
  
  <p>Value of property 'filter' is successfuly injected from the property resource. But I'm getting an exception on property 'count':</p>
  
  <pre><code>     13:58:45.274 [main] WARN  o.s.c.s.GenericApplicationContext - Exception encountered during context initialization - cancelling refresh attempt 
       org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cz.pokus.core.test.config.ConversionServiceTestConfig': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.List cz.pokus.core.test.config.ConversionServiceTestConfig.converterList; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'httpRequestParamsToPaginationParams': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.Integer cz.pokus.core.cases.converter.HttpRequestParamsToPaginationParams.count; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "${cases.caseList.numberOfCasesPerPage}"
  at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]
       ...
       Caused by: org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "${cases.caseList.numberOfCasesPerPage}"
       ...
       Caused by: java.lang.NumberFormatException: For input string: "${cases.caseList.numberOfCasesPerPage}"
  at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_20]
  at java.lang.Integer.parseInt(Integer.java:569) ~[na:1.8.0_20]
  at java.lang.Integer.valueOf(Integer.java:766) ~[na:1.8.0_20]
       ...
  </code></pre>
  
  <p>When I change type of property 'count' to String it start working:</p>
  
  <pre><code>        @Value("${cases.caseList.numberOfCasesPerPage}")
          private String count;
  </code></pre>
  
  <p>I believe Spring is able to convert String to Integer when injecting value from property resource into a Integer property using @Value. I'v found examples where people use without complaining. Do you please have any ideas why it doesn't work for me? </p>
  
  <p>Thanks a lot in advance.</p>