title: Spring Boot Failed to use @Value for injection
body: <p>Spring Boot version <code>&lt;version&gt;2.2.0.RELEASE&lt;/version&gt;</code></p>
  
  <h2>Error goes as follows:</h2>
  
  <p>Description:</p>
  
  <blockquote>
    <p>Parameter 2 of constructor in
    <code>com.shawn.foodrating.service.impl.AdServiceImpl</code> required a bean of
    type <code>java.lang.Integer</code> that could not be found.</p>
  </blockquote>
  
  <p>Action:</p>
  
  <p>Consider defining a bean of type 'java.lang.Integer' in your configuration.</p>
  
  <h2>My Code:</h2>
  
  <pre class="lang-java prettyprint-override"><code>@Service
  @Transactional(rollbackOn = Exception.class)
  @AllArgsConstructor
  public class AdServiceImpl implements AdService {
   private AdRepository repository;
   private FileService fileService;
   @Value("${app.ad.DefaultPageSize}")
   private Integer DEFAULT_PageSize;
   @Value("${app.ad.ImagePath}")
   private String AD_IMAGE_PATH;
   @Value("${app.ad.ImageUrl}")
   private String AD_IMAGE_URL;
  
  </code></pre>
  
  <p>Load property file </p>
  
  <pre class="lang-java prettyprint-override"><code>
  @SpringBootApplication
  @PropertySource("classpath:app.properties")
  public class FoodRatingApplication {
      public static void main(String[] args) {
          SpringApplication.run(FoodRatingApplication.class, args);
      }
  
  }
  </code></pre>
  
  <p>Not Sure what is wrong with it.</p>