File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Error View could not be restored. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Error View could not be restored." Watch "Error View could not be restored." New topic

Error View could not be restored.

ray frid
Ranch Hand

Joined: Dec 23, 2010
Posts: 79

Hi all, i have deployed successfully my project on tomcat, and I get this error when I try to enter the page
anyone could have any idea what cause this error:

06/01/2011 18:52:04 com.sun.faces.lifecycle.LifecycleImpl phase
WARNING: executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@1baeec3) threw exception
javax.faces.application.ViewExpiredException: viewId:/packages_login.jsf - View /packages_login.jsf could not be restored.
at com.sun.faces.lifecycle.RestoreViewPhase.execute(
at com.sun.faces.lifecycle.LifecycleImpl.phase(
at com.sun.faces.lifecycle.LifecycleImpl.execute(
at javax.faces.webapp.FacesServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at Source)


Srinivasan thoyyeti
Ranch Hand

Joined: Feb 15, 2007
Posts: 557
Ray Frid,

JSF normally saves the UI component tree state either at Client side or at Server side.

Default Server, in this case UI state stored in session context, so if you were happened to delay your submit request (post back) in such a way session timeout happens then
the UI state stored in it also gone with it.

So you would like to handle this exception and display a proper Session time out page.

Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
ray frid
Ranch Hand

Joined: Dec 23, 2010
Posts: 79
Is there any way of preventing this? it happens all the time!

Ofcourse I can handle the exception, and show a proper msg to the user, but isn't it a way of preventing it from first place? or handle it in a way that the page will render itself and work properly?


Srinivasan thoyyeti
Ranch Hand

Joined: Feb 15, 2007
Posts: 557

Try increasing your session timeout in web.xml

I agree. Here's the link:
subject: Error View could not be restored.
It's not a secret anymore!