我使用GWT与春天。我遇到了在RemoteServiceServlet
中使用@Autowired
bean的问题。出于某种原因,这不会自动工作,我需要使用@Configurable
才能正常工作。我跟着this approach,但我仍然得到了NullPointerException
为@Autowired
豆:RemoteServiceServlet与春天autowired给nullpointerexception
@Configurable
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public class AServiceImpl extends RemoteServiceServlet implements AService {
@Autowired
private IABean aBean;
@Override
public void aMethodFromAService(Args arg[]) {
aBean.aMethodOfABean(); // this gives a NullPointerException
}
}
@Component
public class ABean implements IABean {
...
}
中正在发生的事情的任何指导?我需要提供哪些额外信息?
你在哪里/你如何在春季宣布你的ABean? XML或注释? – spiritwalker 2013-02-13 12:29:33
注释,已编辑原文 – Vjeetje 2013-02-13 12:33:56
您是否在应用程序上下文文件中具有以使ABean成为注入的候选人。 –
spiritwalker
2013-02-13 12:38:03