3 Replies Latest reply on May 12, 2008 4:49 PM by Pete Muir

    Seam Exception handling leads to exception

    dave atkins Newbie

      Hello,


      I'm trying to use Seam's exception handling to catch an application exception.  My entry in pages.xml is



         <exception class="com.xyx">
            <redirect>
               <message>Exception Occured</message>
            </redirect>
         </exception>




      I expected the message to appear at the top of the page the user was on when submitting the form that caused the exception.


      Seam returns the following stack trace



      javax.el.ELException: Expression cannot be null
           at org.jboss.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:92)
           at org.jboss.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:151)
           at org.jboss.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:195)
           at org.jboss.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:68)
           at org.jboss.seam.el.SeamExpressionFactory.createValueExpression(SeamExpressionFactory.java:98)
           at org.jboss.seam.core.Expressions$1.createExpression(Expressions.java:106)
           at org.jboss.seam.core.Expressions$1.toUnifiedValueExpression(Expressions.java:98)
           at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:111)
           at org.jboss.seam.exception.ConfigRedirectHandler.getViewId(ConfigRedirectHandler.java:50)
           at org.jboss.seam.exception.RedirectHandler.handle(RedirectHandler.java:33)
           at org.jboss.seam.exception.Exceptions.handle(Exceptions.java:75)
           at org.jboss.seam.web.ExceptionFilter.endWebRequestAfterException(ExceptionFilter.java:114)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:70)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:256)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:362)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:488)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at com.prolog.security.filter.GZIPFilter.doFilter(GZIPFilter.java:37)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
           at java.lang.Thread.run(Thread.java:595)
      



      According to the 2.0.1 manual I can do this (see section 5.3.5. Some common exceptions, 'If you are using Seam Security:').  Is this a mistake in the manual or am I doing something wrong?


      Cheers,


      Dave