title: Autowired Environment is null
body: <p>I have an issue with connecting environment to my Spring project.
  In this class </p>
  
  <pre><code>@Configuration
  @ComponentScan(basePackages = "my.pack.offer.*")
  @PropertySource("classpath:OfferService.properties")
  public class PropertiesUtil {
      @Autowired
      private Environment environment;
  
  
  
      @Bean
      public String load(String propertyName)
      {
          return environment.getRequiredProperty(propertyName);
      }
  }
  </code></pre>
  
  <p>environment always is null. </p>