Nullpointer in waf-part of the petstore
Hello!I'm looking at the petstore app from sun and now I need help with it. I guess that it is easier to answer this if you are familier to that example app.
In the class RequestProcessor there is a method called processRequest. That method got these 3 lines of code:
ComponentManager sl = (ComponentManager)request.getSession().getAttribute(WebKeys.COMPONENT_MANAGER);
WebController wcc = sl.getWebController(request.getSession());
eventResponse = wcc.handleEvent(ev, request.getSession());
I always got a NullPointer at the second line of these 3 lines. The cuase is that there is no COMPONENT_MANAGER manager in the Session.
So I searched throug the Petsore for:
session.setAttribute(WebKeys.COMPONENT_MANAGER
...and found it in a method called sessionCreated in the class DefaultComponentManager.
So I started to search where sessionCreated is called but can't find it. So the COMPONENT_MANAGER seems to never be put into the session.
But to get this to work it has to be done somewhere.
I'm not so familier with this architecture yet so if anyone could explanie how this should be possible or tell me what I have to do I would be most grateful.
Best regards
Fredrik
