0

When I get a ViewExpiredException (in development I force this by cleaning Tomcat's work directory) FullAjaxExceptionHandler is not redirecting to the error page after an PrimeFaces' AJAX request. See the stack trace below:

GRAVE: FullAjaxExceptionHandler: An exception occurred during processing JSF ajax request. Error page '/Erro.jsf' will be shown.
javax.faces.application.ViewExpiredException: viewId:/PesquisaBeneficiario.jsf - A exibição de /PesquisaBeneficiario.jsf não pôde ser restaurada.
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:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at br.com.bb.sgn.jsf.util.FiltroDesabilitaCacheNavegador.doFilter(FiltroDesabilitaCacheNavegador.java:30)
at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.omnifaces.filter.FacesExceptionFilter.doFilter(FacesExceptionFilter.java:56)
at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at br.com.bb.sgn.jsf.util.sso.FiltroSeguranca.doFilter(FiltroSeguranca.java:140)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

And I registered the error page as:

<error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/Erro.jsf</location>
</error-page>

I saw the question stackoverflow.com/questions/15320192/jsf-error-page-not-shown-when-viewexpiredexception-occurs and updated OmniFaces to 1.4.1 version already.

Is there something I'm missing? Thanks.

PS: Mojarra-2.1.20, OmniFaces-1.4.1, PrimeFaces-3.5

Community
  • 1
  • 1
EliandroRibeiro
  • 991
  • 8
  • 9
  • Are you completely sure about version of OmniFaces, as this should be fixed from version 1.4? You didn't accidentally left old version somewhere in lib? – partlov Mar 15 '13 at 20:03
  • How does the HTTP response look like? What browser are you using? Are there any JS errors in the console? – BalusC Mar 15 '13 at 20:12
  • @partlov: Yes, I'm completely sure about it. Indeed, I receive the console message "INFO: Using OmniFaces version 1.4.1". – EliandroRibeiro Mar 15 '13 at 21:06
  • @BalusC: **1)** How do I answer this question? The only thing that happens is `p:blockUI` animation that starts and stops. **2)** Chrome 25.0.1364.172 m and Firefox 19.0.2. **3)** Nothing in JS console, nor JS errors. – EliandroRibeiro Mar 15 '13 at 21:13
  • In Chrome, press F12 and open the *Network* tab. All HTTP traffic is monitored and visible in there. I'm interested in the HTTP response headers and body of the ajax request in question. In Firefox, you need to install Firebug first to have the same tools behind F12. – BalusC Mar 15 '13 at 21:15
  • RESPONSE HEADERS `Cache-Control:no-cache Cache-Control:no-cache Cache-Control:no-cache, no-store, must-revalidate Content-Type:text/xml;charset=UTF-8 Date:Fri, 15 Mar 2013 21:23:15 GMT Expires:Thu, 01 Jan 1970 00:00:00 GMT Pragma:no-cache Server:Apache-Coyote/1.1 Set-Cookie:JSESSIONID=0F4251003E5A678DA00E3E8FA1FCA442; Path=/rtd/; HttpOnly Transfer-Encoding:chunked X-Powered-By:JSF/2.0 X-Powered-By:JSF/2.0` – EliandroRibeiro Mar 15 '13 at 21:29
  • RESPONSE BODY ` <![CDATA[2616588733663656126:8690983128078854320]]>` – EliandroRibeiro Mar 15 '13 at 21:29
  • I tryed removing `` and its references, but didn't work. – EliandroRibeiro Mar 15 '13 at 21:51
  • Okay, the response body contains an empty ajax response. That is indeed not right. I guess that your problem is the same as https://code.google.com/p/omnifaces/issues/detail?id=116 which is still unfixed. It's caused by using Mojarra in combination with PrimeFaces ajax in a specific circumstance, which I haven't yet figured out. It was reported to work fine when using MyFaces. Can you try if it works for you as well when replacing Mojarra by MyFaces? – BalusC Mar 15 '13 at 21:55
  • You were right. With MyFaces it worked fine. By the way, which implementation do you prefer? – EliandroRibeiro Mar 18 '13 at 14:49

0 Answers0