7 Replies Latest reply on Feb 4, 2008 4:18 AM by saasira

    handleException details

    saasira

      How can I get printstacke trace if we use seam declarative exception handling. Can we make seam exception handling to route to some bean instead of error page like in struts ?

        • 1. Re: handleException details
          nickarls

          The exception should be available in org.jboss.seam.handledException, you should be able to get the full stack trace from there.

          • 2. Re: handleException details
            nickarls

            Meaning that you should be able to forward to a page that uses a bean that injects the exception and then generates a String from the stacktrace.

            • 3. Re: handleException details
              saasira

              How it injects the exception? Could you please give some example.
              I have something like this


              <end-conversation/>
              <redirect view-id="/error.seam">
              Unexpected error: #{org.jboss.seam.handledException.getMessage()}

              • 4. Re: handleException details
                pmuir

                 

                @In Exception handledException;


                • 5. Re: handleException details
                  saasira

                  Hi,

                  @In is throwing exception as below


                  ExceptionFilt E org.jboss.seam.web.ExceptionFilter doFilter exception root cause
                  org.jboss.seam.RequiredException: @In attribute requires non-null value: errorbean.handledException

                  • 6. Re: handleException details
                    nickarls

                    Then make in non-required. Depending on the scope and how/where the bean is referenced, it might be created even when there was no error...

                    • 7. Re: handleException details
                      saasira

                      Exception that I injected was null.
                      But I could get that exception as

                      Exception excp= (Exception)Contexts.getConversationContext().get("org.jboss.seam.handledException");
                      if (excp != null && excp instanceof Exception) {
                      System.out.println("error" + excp.getClass().getName());
                      excp.printStackTrace();

                      but printStacjTrace doesnt print anything now. But esxception class name is proper.