Skip to main content

Possible Mojarra 2.0.3 RestoreViewPhase Bug

1 reply [Last post]
Joined: 2010-07-28
Points: 0


I'm, very excited with JSF 2.0. I'm using JSF since 2005 and this version was a great advance.

I was using mojarra 2.0.2 and everything was OK. But this week I upgraded to 2.0.3-b03 and after this I'm getting the following error:

at com.sun.faces.lifecycle.RestoreViewPhase.notifyAfter(
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(
at com.sun.faces.lifecycle.LifecycleImpl.execute(
at javax.faces.webapp.FacesServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(

I have a "PhaseListener" that is invoked in "PhaseId.INVOKE_APPLICATION" (/autocomplete.faces for example). In this phaselistener I use some "logical actions" (aka action without a correspondent .xhtml file) to handle some JQuery ajax requests (autocomplete for example).

In version 2.0.2 the line "ViewMetadata metadata = vdl.getViewMetadata(facesContext, viewId)" inside the "execute" method of "RestoreViewPhase" class returns "null". In 2.0.3 the mojarra returns a instance of ViewMetadata. But in the sequence, the line "viewRoot = metadata.createMetadataView(facesContext)" throws an IO exception because can't find the file "/autocomplete.xhtml). This file doesn't exists because, as I told, this is a "logical action".

Then in "finally" declaration of "execute" method of "RestoreViewPhase" class the method "deliverPostRestoreStateEvent" is called. It thows an "IllegalArgumentException", and after this the method "notifyAfter" of "RestoreViewPhase" class is called too, then the "NullPointerException" occurs inside this method (as can be seen in StackTrace).

Is this a Bug? I'm doing something wrong?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2008-03-26
Points: 0

This seems like a bug in JSF 2.0.3+ but I haven't had a chance to trace the root cause yet ... PrettyFaces users are complaining that they are receiving the same exception when trying to access deployed apps - this is caused simply by upgrading JSF versions from 2.0.2 to anything higher...