webtier@glassfish.java.net

Possible Mojarra 2.0.3 RestoreViewPhase Bug

From: <webtier_at_javadesktop.org>
Date: Wed, 28 Jul 2010 13:26:13 PDT

Hi,

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:

java.lang.NullPointerException
        at com.sun.faces.lifecycle.RestoreViewPhase.notifyAfter(RestoreViewPhase.java:288)
        at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
....

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?

Thanks.
[Message sent by forum member 'rbsrodrigues']

http://forums.java.net/jive/thread.jspa?messageID=478740