We have a big problem with Mojarra 2.0.3 - a NullPointerException during
application startup. We have upgraded all web apps to Mojarra 2.0.3 and have
faced this exception. Afterthat we have compared the changes and seen the
following difference: You added a new method notifyAfter() to the Phase.java.
notifyAfter() is called from com.sun.faces.lifecycle.RestoreViewPhase.doPhase(),
gets UIViewRoot from FacesContext and calls AfterPhaseListener for this
ViewRoot. Sadly, but you didn't check if ViewRoot is null. In our case it's
null. ViewRoot can not be created with our security stuff. Our scenario:
1) User calls the web app and is not authentificated.
2) A security filter doesn't make a redirect to the login page self, but passes
the current request through FacesServlet to a special JSF phase listener.
3) The JSF phase listener makes a redirect to the login page in the
4) The ViewRoot creation step is skipped because response has beed completed.
See this block in Phase.java
handleBeforePhase(context, listeners, event);
Steps 2) and 3) are necessary by reason of Ajax redirects (JSF 2 facility). We
let execute redirects by JSF and not by security filter in order to consider
Here is a small log with the NPE
This is a Mojarra 2.0.3 bug. Many people have a similar problem. See e.g.
Thanks in advance for the bugfixing!