I have a logger class that makes use of a service. Each time a new logger is created, I expect to have access to the singleton scoped logging service.
I autowire the
Just want to add my 2 cents.
I once encountered the same issue when I was not quite used to the life in the IoC world. The @Autowired field of one of my beans is null at runtime.
The root cause is, instead of using the auto-created bean maintained by the Spring IoC container (whose @Autowired field is indeed properly injected), I am newing my own instance of that bean and using it. Of course this one's @Autowired field is null because Spring has no chance to inject it.