global exception handler sometimes gets a null exception

2006-02-02 Thread Michael Davis
Hello, I'm working on a struts application which has just been deployed and is being used by a large number of users. I've got an error handler set up using the global-exceptions tag. It sends me an email whenever it catches an exception. My config looks like this: global-exceptions

Re: global exception handler sometimes gets a null exception

2006-02-02 Thread Vladislav Pernin
Maybe it happens when the error is not thrown by Struts, so try to use the JSP directive %@ page isErrorPage=true % which give you access to the implicit variable exception. You can also use a exception handler : exception type=java.lang.Throwable key=error.error

Re: global exception handler sometimes gets a null exception

2006-02-02 Thread Frank W. Zammetti
With the caveat that I looked at things for all of 30 seconds so I could be WAY wrong... Looking at the Struts source, the RequestProcessor.processException() method is where your custom handler gets called from. I notice that the request attribute is NOT set there. In fact, there is no

Re: global exception handler sometimes gets a null exception

2006-02-02 Thread Mark Shifman
What I do is log the exception and the stack trace and then let the super do the rest. Since I was getting null comming up on the error page, I check the exception message and if it is null I at least show the name of the exception class name on the error page (probably not too pretty but..)

Re: global exception handler sometimes gets a null exception

2006-02-02 Thread Michael Davis
Thanks for your prompt replies! I will try supplying my own exception handler. Looking at the struts source code for the exception handler, I see: // Figure out the error if (ex instanceof ModuleException) { error = ((ModuleException) ex).getActionMessage();