Spring autowired bean causes null pointer

后端 未结 5 1721
死守一世寂寞
死守一世寂寞 2020-12-19 04:55

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

5条回答
  •  遥遥无期
    2020-12-19 05:43

    If you are using AspectJ you can use @Configurable:

    @Configurable
    public class OurLogger {
      ..
    }
    

    See: Using AspectJ to dependency inject domain objects with Spring

提交回复
热议问题