title: Strange exception on injection of primitive via Spring @Value annotation
body: <p>I have strange error on attempt to inject int primitive via Spring @Value annotation (Spring version 3.2.13). Short description: Spring is trying to inject bean of primitive type (int in my case) instead of primitive itself.</p>
  
  <ul>
  <li><p>I have property file "myProps.properties" with property </p>
  
  <pre><code>number.of.search.log.events.in.queue=4
  </code></pre></li>
  <li><p>Configuration class on scanned path with content</p>
  
  <pre><code>@Configuration
  @ComponentScan(basePackages = {
          "com.search.log"
  })
  @PropertySource("classpath:myProps.properties")
  @EnableAspectJAutoProxy
  public class SearchLogConfiguration {
  
      @Bean
      public static PropertySourcesPlaceholderConfigurer  propertySourcesPlaceholderConfigurer() {
          return new PropertySourcesPlaceholderConfigurer();
      }
  
  }
  </code></pre></li>
  <li><p>Aspect where primitive should be injected</p>
  
  <pre><code>@Aspect
  @Component
  public class SearchLogAspectHandler {
  
      @Value("${number.of.search.log.events.in.queue:2}")
      public int numberOfSearchLogEventsInQueue;
  ...
  }
  </code></pre></li>
  </ul>
  
  <p>Every time on application start I got this exception:</p>
  
  <pre><code>Injection of autowired dependencies failed; nested exception is   org.springframework.beans.factory.BeanCreationException: Could not autowire field: public int numberOfSearchLogEventsInQueue; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [int] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Value(value=${number.of.search.log.events.in.queue})}
  at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:298)
  </code></pre>
  
  <p>Also primitives can't be injected into other beans as well.</p>
  
  <p>Question: Please, help to find out why Spring can't inject primitive, but instead is trying to inject bean of type [int] and can't found one.</p>