title: No saved view state could be found for the view identifier, still no valid solution
body: <p>I do realize that there are several topics like this here, however I couldn't find anything there that would help me.</p>
  
  <p>I get this exception randomly at clicking buttons. Yet the next time I click the same button in a second it works just fine.</p>
  
  <p><strong>Apache Log</strong></p>
  
  <pre><code>Dec 09, 2015 12:05:39 PM org.omnifaces.exceptionhandler.FullAjaxExceptionHandler logException
  SEVERE: FullAjaxExceptionHandler: An exception occurred during processing JSF ajax request. Error page '/loginViewExpired.xhtml' will be shown.
  javax.faces.application.ViewExpiredException: /login.xhtmlNo saved view state could be found for the view identifier: /login.xhtml
  at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:171)
  at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
  at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:44)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
  at ru.nspk.system.server.jsf.AuthFilter.doFilter(AuthFilter.java:55)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p><strong>Web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.apache.myfaces.webapp.StartupServletContextListener&lt;/listener-class&gt;        
      &lt;/listener&gt;  
      &lt;context-param&gt;
          &lt;param-name&gt;org.richfaces.LoadScriptStrategy&lt;/param-name&gt;
          &lt;param-value&gt;ALL&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;org.richfaces.LoadStyleStrategy&lt;/param-name&gt;
          &lt;param-value&gt;ALL&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;org.richfaces.resourceOptimization.enabled&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
      &lt;param-name&gt;org.apache.myfaces.SERIALIZE_STATE_IN_SESSION&lt;/param-name&gt;
      &lt;param-value&gt;false&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt;
          &lt;param-value&gt;server&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.PARTIAL_STATE_SAVING&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;facelets.DEVELOPMENT&lt;/param-name&gt;
          &lt;param-value&gt;false&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
          &lt;param-value&gt;Production&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;session-config&gt;
          &lt;session-timeout&gt;
              60
          &lt;/session-timeout&gt;
      &lt;/session-config&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;HelloWorldServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;ru.nspk.system.server.HelloWorldServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;HelloWorldServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/HelloWorldServlet&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;login.xhtml&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
      &lt;error-page&gt;
          &lt;error-code&gt;500&lt;/error-code&gt;
          &lt;location&gt;/loginError.xhtml&lt;/location&gt;
      &lt;/error-page&gt;
      &lt;error-page&gt;
          &lt;exception-type&gt;javax.faces.application.ViewExpiredException&lt;/exception-type&gt;
          &lt;location&gt;/loginViewExpired.xhtml&lt;/location&gt;
      &lt;/error-page&gt;
      &lt;error-page&gt;
          &lt;exception-type&gt;java.lang.Throwable&lt;/exception-type&gt;
          &lt;location&gt;/loginError.xhtml&lt;/location&gt;
      &lt;/error-page&gt;
      &lt;ejb-local-ref&gt;
          &lt;ejb-ref-name&gt;PlatformCertificationLogManagement&lt;/ejb-ref-name&gt;
          &lt;ejb-ref-type&gt;Session&lt;/ejb-ref-type&gt;
          &lt;local-home/&gt;
          &lt;local&gt;ru.nspk.system.server.ejb.session.LogManagementLocal&lt;/local&gt;
          &lt;ejb-link&gt;PlatformCertificationLogManagementBean&lt;/ejb-link&gt;
      &lt;/ejb-local-ref&gt;
      &lt;ejb-local-ref&gt;
          &lt;ejb-ref-name&gt;PlatformCertificationUserManagement&lt;/ejb-ref-name&gt;
          &lt;ejb-ref-type&gt;Session&lt;/ejb-ref-type&gt;
          &lt;local-home/&gt;
          &lt;local&gt;ru.nspk.system.server.ejb.session.UserManagementLocal&lt;/local&gt;
          &lt;ejb-link&gt;PlatformCertificationUserManagementBean&lt;/ejb-link&gt;
      &lt;/ejb-local-ref&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I tried adding to my Web.xml:</p>
  
  <pre><code>&lt;context-param&gt;
  &lt;param-name&gt;org.apache.myfaces.SERIALIZE_STATE_IN_SESSION&lt;/param-name&gt;
  &lt;param-value&gt;false&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p>then:</p>
  
  <pre><code>&lt;context-param&gt;
  &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt;
  &lt;param-value&gt;server&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p>Then I made sure all of my beans were serializable. And yet I still receive the same random mistake every now and then.</p>