1.普通注入
@Autowired
private Service service;
报:java.lang.NullPointerException
2.解决方案
@Autowired
private Service service;
private static 自己的类名 随便给个变量;
@PostConstruct
public void init(){
变量 = this;
变量.service= this.service;
}
1.普通注入
@Autowired
private Service service;
报:java.lang.NullPointerException
2.解决方案
@Autowired
private Service service;
private static 自己的类名 随便给个变量;
@PostConstruct
public void init(){
变量 = this;
变量.service= this.service;
}