4 Replies Latest reply on Jan 17, 2008 12:10 PM by Alexander Pavlov

    Sometimes error messages shown only after page refresh

    Alexander Pavlov Newbie

      Hi folks!

      I faced strange behaviour when tried to display error page for all uncatched exceptions: sometimes error messages are displayed, sometimes I see empty error page and need refresh page to see messages.

      My error page

      <ui:composition template="/jspx/template.jspx"
       <ui:define name="pageContent">
       There has been an error.

      Global exceptions handler declared in pages.xml
       <redirect view-id="/error.jspx">
       Unrecoverable error. If you edited some data then these have not been saved. Details:

      Seam debug mode and facelet development mode are disabled.

      How I tested: Open form and enter duplicate value to unique field, JDBC driber throws ConstraintViolation exception, it successfully propagated to declared handler, it successfully adds error message to FacesMessages.instance(), and redirects to error.jspx BUT when page opens I sometimes do not see messages and need to refresh page.

      Looks like there is some racing between handled exception processing and next page rendering - sometimes messages are added BEFORE page rendered and all is ok, sometimes page rendered BEFORE messages added and I need refresh.

      Under debugger all works fine (as I understand my breakpoints suspends page rendering so there is no racing).

      What to do?

      Thanks in advance!