1

I have recently deployed my first JSF 2.0 site to openshift. It runs fine under Chrome and the index.xhtml page loads fine in other browsers but as soon as i click the:

<h:commandLink id="aboutUs" action="aboutUs">

or any other commandLink i get the following error:

javax.faces.application.ViewExpiredException: viewId:/index.xhtml - View /index.xhtml could not be restored.
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:205)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
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:368)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
at java.lang.Thread.run(Thread.java:679)

This happens in Internet Explorer and also on my iPhone but not on Chrome.

Although the site has Java Script and CSS, some of the pages that it links to only have head and body JSF tags with no JS. For this reason I am really confused why it is happening as i cannot see it being a JS or CSS issues.

Help please.

Thanks

EHarpham
  • 602
  • 1
  • 17
  • 34

1 Answers1

1

I believe that's because you are using h:commandLink for navigation. You are doing a postback, and then changing from one view to another.

Use h:outputLink or h:link instead, or even a straight HTML link <a href="/index.html">Index</a> for navigation, and it should work everywhere.

Also, check this Q&As:

"This link is deactivated, because it is not embedded in a JSF form."

When should I use h:outputLink instead of h:commandLink?

Community
  • 1
  • 1
Elias Dorneles
  • 22,556
  • 11
  • 85
  • 107