Hello,
I get a nullpointerexception upon restart of my web container. I know exactly which object is null (it is a variable of a session scoped object) but I don't know why it is not reinstanciated by the container and injected into the session scoped object.
Here is the code in the session-scoped SuggestionOeuvreView class that raises the npe:
Here is the code related to that variable instanciation (still in the same class):Code:private Sculpture _suggererSculpture() { log.debug("_suggererSculpture"); log.debug("Etat de la liste: " + this.sculpturesNonVisitees); if (!this.sculpturesNonVisitees.isEmpty() && this.sculpturesNonVisitees.peek() != null) { Integer idSculptureSuggeree = this.sculpturesNonVisitees.pollFirst(); this.sculpturesNonVisitees.addLast(idSculptureSuggeree); log.debug("jbmService: " + jbmService); return jbmService.findByID(idSculptureSuggeree);//the jbmService object is null hence the npe!! } else { log.error("Probleme dans _suggererSculpture"); return null;//todo } }
Code:private transient JbmService jbmService; @Autowired public SuggestionOeuvreView(JbmService jbmService) { log.debug("SuggestionOeuvreView()"); this.jbmService = jbmService; this.sculpturesNonVisitees = recupererSculpturesNonVisitees(); } @Autowired public void setJbmService(JbmService jbmService) { this.jbmService = jbmService; }
Here is the code of the request-scoped AccueilView class that HAS a SuggestionOeuvreView variable.
FYI I use JSF 1.2, Tomcat 6.0.18, Spring 2.5.5, Spring Java Config, I don't use XML in order to configure Spring.Code:@Autowired @ScopedProxy public void setSuggestionOeuvreView(SuggestionOeuvreView suggestionOeuvreView) { log.debug("setSuggestionOeuvreView"); this.suggestionOeuvreView = suggestionOeuvreView; }
Can anyone please help?
Thanks in advance,
Julien.


Reply With Quote
