I am trying to Autowire Environment class into my class Customer for example.
public class Customer implements Callable<Person> {
@Autowired
private Environment env;
//dao logic
}
Also I have my main method like:
@Configuration
@ComponentScan({"org.test"})
@PropertySource("classpath:app.properties")
public class Application {
}
But when I try to autowire Environment in Customer class , the instance returns null. I assume it is because my Customer class is implementing Callable iterface but not sure why the env is null.
Any thoughts are appreciated.