Announcement Announcement Module
Collapse
No announcement yet.
Beginner needs help with basic spring concepts... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Beginner needs help with basic spring concepts...

    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:
    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
            }
        }
    Here is the code related to that variable instanciation (still in the same class):
    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.
    Code:
     @Autowired
        @ScopedProxy
        public void setSuggestionOeuvreView(SuggestionOeuvreView suggestionOeuvreView) {
            log.debug("setSuggestionOeuvreView");
            this.suggestionOeuvreView = suggestionOeuvreView;
        }
    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.

    Can anyone please help?

    Thanks in advance,

    Julien.

  • #2
    Can I provide more information in order to get a reply? If so please say what.
    Thanks in advance,
    J.

    Comment

    Working...
    X