Here's my error-page in the DD:
I'm using Tomcat 7.0.6. I'm precompiling the JSPs with org.apache.jasper.JspC and I can verify that the elError.jsp is compiled and deployed to the WEB-INF/lib directory.
I googled and searched for an answer, but no luck.
Bear Bibeault wrote:I've seen this happen when the error page itself contains an error. Is that a possibility here?
Bear Bibeault wrote:Ah! WEB-INF/lib? (missed that on first read). Why is it there?
According to your DD, it should be in the context root.
All the precompiled JSP classes are stored in a jar file in WEB-INF/lib. I've never had a problem with this approach as there are other error pages (error codes only - no exceptions) at the root level.
Just in case, I did put elError.jsp at the root level. Same result.
I did find this thread on StackOverflow, but his problem was caused by an intercepting filter. I don't have any filters on my application.
In the meantime, I'm going to create an error page for an ArithmeticException like the example in Head First Servlets and JSP. I want to ensure that Tomcat can find an error page for a specific exception.
Bear Bibeault wrote:Does it work if you do not precompile?
I put the uncompiled jsp in the root directory. No luck.
I also tried the ArithmeticException error page and it didn't find it either. Seems like Tomcat doesn't like the Exception pages.
Yet, Tomcat can find my error code pages without a problem:
I seem to recall that the error page mechanism is disabled during the invocation of a filter's doFilter method.
You might consider having an outer-most filter act as your own error page handler.
Additional info based on comment:
The error page mechanism is disabled for the request because it is being processed by one or more filters (e.g. IPControlFilter and SessionAuthFilter).
It doesn't have anything to do with applying a filter to your error page. The "outer-most filter" I mentioned would be mapped to /* and would simply do something like:
I am forwarding the request to the JSP which contains the EL error. The only Filter I see in the stack trace is org.apache.catalina.core.ApplicationFilterChain.doFilter().