Oscar, Comments in-line...
Oscar Westra van Holthe - Kind wrote: > I may have missed the point too, given your description. The NPE tells me > that the class is in an invalid state. Let's go back to the more simplified example in this thread: public class BaseActionBean implements ActionBean { @SpringBean protected ModalityDao modalityDao; ... @Repository("modalityDao") public class ModalityDaoImpl extends BaseDaoImpl<Modality, Integer> implements ModalityDao { public List<Modality> findAll() { return (this.load()); // [2] } @PostConstruct private void init() { this.findAll(); // [1] } And let's show the ApplicationContext.xml relevant snippet: <context:annotation-config /> <context:component-scan base-package="org.lightagents.ws.dao.impl.stripersist" /> The modalityDao bean is indeed constructed and all is well except that the init() post construct at [1] results in the call at [2] which results in calls to the underlying Stripersist Interceptor were in IT is not initialized. Clearly Stripersist plumbing is in an invalid state but how to get this to work is the question! > Some of the reasons may be that Spring > isn't injecting that state (at all or yet), Not sure what you mean by this... . > another that the interceptors are > called in the wrong order. Due to the annotations, > I do not believe the latter. > Right. The Stripersist interceptor intercepts at RequestInit which is "before" the Spring intereceptor which intercepts at ActionBeanResolution. > As a result, I try to structure the code to force it to initialize the > autowired dependencies first. Constructor injection does that, though I do > not know if there is another way. Failing that, I'd hazard a guess that > Spring isn't managing the instance that throws a NPE. > I hear you however I'm still not sure how this would help as even with Constructor injection you still need to have a way for the bean itself to fully initialize itself. In fact, the reduced case re-presented above doesn't even have any additional @Autowire dependency so it is just this bean that needs to be created and initialized. I am really open to what you are saying I just don't see how Constructor injection will solve this. Can you please outline your solution using the snippet of code above? Thank You --Nikolaos ------------------------------------------------------------------------------ _______________________________________________ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users