1

i've created this webpage using jsf,prettyfaces and hibernate i looked around and most people says that this error is because of cache most of them found this error after login,logout and try to login back but i found this error when i log in,and when i try to navigate to any other page,any link that i clicked will produce this error

what makes it harder is that this error doesnt occur everytime sometimes when i try restart the server,login back,everythin work just fine but sometimes when this error occur again, i tried restart the server and try login back.the same error still occur

javax.faces.application.ViewExpiredException: viewId:/ePortfolio.jsf - View /ePortfolio.jsf could not be restored.
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:212)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:112)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
tokwan
  • 11
  • 1
  • 2
  • 2
    Pease check [this](http://stackoverflow.com/questions/3642919/javax-faces-application-viewexpiredexception-view-could-not-be-restored) – jmj Apr 06 '11 at 08:51

2 Answers2

1

JSF keeps a (configurable) number of views in the session. You will get this ViewExpiredException if you do a post to a view that cannot be restored anymore, ie. not present anymore in the list of views for that session.

There can be multiple reasons for this. Two possible scenario's I can think of right now are:

  • Session invalidated/expired
  • Multiple (> configured number of sessions in view) views being created after the one that should be restored
wjans
  • 10,009
  • 5
  • 32
  • 43
0

To my understanding this is caused by the combination of several things:

  • A JSF-form containing an internal id for a field has been generated.
  • The JSF-page has been changed, or the whole application redeployed, causing the internal ids to change.
  • The JSF-form with the old internal id is submitted (a login page?) and the old internal id cannot be found in the new ids for the JSF-page.

You must have the page refreshed in the browser (getting the new id's) before attempting to submit again.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347