@Autowiredセッターゲッターインジェクションを持つSpringBeanがあります。ただし、注入されたBeanにアクセスしようとすると、注入されたBeanが実際に注入されていないため、NullPointerExceptionが発生します。
コンストラクションコールの前に注入が行われることを保証する方法はありますか?
@Component
@Scope("session")
public class A{
@Autowired
B;
public A()
{
//B is null here, because it has not been injected yet.
}
//Setter Getters
}