0

My application uses JSF 2.0.6 and RichFaces 4.1.0. I implemented an ExceptionHandler which normally displays all exception in popup windows, and is working fine.

But something goes wrong when I disable partial state saving with this context param:

<context-param>
  <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
  <param-value>false</param-value>
</context-param>

Or this one:

<context-param>
  <param-name>javax.faces.FULL_STATE_SAVING_VIEW_IDS</param-name>
  <param-value>/index.xhtml</param-value>
</context-param>

When the session is expired, any action I do in the application throws a NullPointerException :

com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:96) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) javax.faces.webapp.FacesServlet.service(FacesServlet.java:509)

I looked into RenderResponsePhase.java:96 and it corresponds to this:

    ViewDeclarationLanguage vdl =
          vh.getViewDeclarationLanguage(facesContext,
                                            facesContext.getViewRoot().getViewId());

In fact, the viewRoot is null !

This never happens when the Partial state saving is enabled or if the session isn't expired.

I need to activate the full state saving option for some reasons but I don't know how to handle correctly errors when the session is expired. I suppose this to be a JSF bug, and I'd like to fix it on my web app.

Additional information: Server: Tomcat 6.0.18

kev
  • 95
  • 1
  • 2
  • 8
  • Mojarra 2.0.6 is over 1.5 years old already. Have you tried the current version? The bug might already have been fixed (although I don't recognize this one). – BalusC Nov 19 '12 at 16:52
  • Yes I tried, and it works fine with the latest version (2.1.14), but it's a bit long and complicated to change libraries on my project... – kev Nov 19 '12 at 17:29
  • Well.. This is not a problem we could solve, right? – BalusC Nov 19 '12 at 17:45
  • Ok, it was just in case it was possible to fix it without updating libraries. Thanks for your help. – kev Nov 20 '12 at 08:32
  • You could sneak a copy of the Mojarra-specific class containing the fix into the webapp source folder. It would get precedence in classloading over the one in the JAR. But I would really prefer just replacing the JAR altogether with a newer version. – BalusC Nov 20 '12 at 10:30

0 Answers0