posted 9 years ago
Hey all
I am new to Spring and learning the DI. I have three simple classes for an experiment.
Class1:
Class2:
Class3:
Beans.xml:
But as pointed in code, it keeps giving me NPE. Even using @Autowired in Class3 gives error. Please suggest what am I doing wrong?
EDIT:
If I dont set the scope to be prototype, it works fine. Else it doesn't.
But I need the scope to be prototype since I want this bean to have a new instance everytime its launched (I am calling it using a button click. But I did not include that code for sake of simplification).