I'm using GWT with Spring. I encountered the problem of using an @Autowired
bean in a RemoteServiceServlet
. For some reason this doesn't work automatically and I need to use @Configurable
to get this working. I followed this approach but I still get a NullPointerException
for the @Autowired
bean:
@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 {
...
}
Any guidance in what is going on? Any extra information I need to provide?