I'm not a Spring pro, so please bear with me....
I have three classes:
class SpringBeanA {
public aMethod() {
.....
}
}
class SpringBeanB {
@Autowired SpringBeanA a;
public bMethod() {
a.method();
}
}
class NONSpringClass {
.....
b.method();
.....
}
b.method()
gives a null pointer error, both when accesed via the instances SpringBeanB b = new SpringBeanB()
and autowiring SpringBeanB to NONSpringClass.
The autowiring:
class NONSpringClass {
@Autowired SpringBeanB b;
.....
b.method();
.....
}
How can I successfully call b.method()
?