spring autowiring not working from a non-spring managed class

前端 未结 10 922
暗喜
暗喜 2020-12-03 06:43

I have a class (Class ABC) that\'s instantiated by calling the constructor. Class ABC in turn has a helper class (Class XYZ) injected using auto-wired.

Ours is a Sp

10条回答
  •  甜味超标
    2020-12-03 07:49

    Correct: You can't just call new on a class and get it all wired up; Spring has to be managing the bean for it to do all of its magic.

    If you can post more details on your use case, we may be able to suggest useful options.

提交回复
热议问题