10 Replies Latest reply on Oct 22, 2007 3:27 PM by Matthew Lieder

    Default Exception Handler doesn't work

    Ging Ming Chan Newbie

      I've the following in the pages.xml:

       <exception>
       <end-conversation />
       <redirect view-id="/error.xhtml">
       <message>Unexpected Failure. Cause: #{handledException.message}</message>
       </redirect>
       </exception>
      


      However, when exception occurred, it couldn't catch it and tries to redirect the user to the debug.xml page.

      I then added
       <exception class="org.jboss.seam.InstantiationException">
       <end-conversation />
       <redirect view-id="/error.xhtml">
       <message>Unexpected Failure. Please check the system configuration. Cause: #{handledException.message}</message>
       </redirect>
       </exception>
      

      to catch the exception throw. It can now redirect correctly, however, it couldn't get the message out from the handledException object.

      I've added the following filter in my web.xml:
       <filter>
       <filter-name>SeamExceptionFilter</filter-name>
       <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>SeamExceptionFilter</filter-name>
       <url-pattern>*.xhtml</url-pattern>
       </filter-mapping>
      


      I've also tried with the org.jboss.seam.web.SeamFilter but the same problem occurs.

      Are there still bugs in the exception handling mechanism or is my configuration incorrect? I'm using Seam 1.2.1.GA, however, when it starts up, it still displays

      29 Mar 2007 12:32:44,389 | 0 [INFO ] {main} (javax.servlet.ServletContextListener) Welcome to Seam 1.2.0.PATCH1
      

      in the Eclipse IDE Console output.