Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I fixed a similar problem in my <code>error.jsp</code> page today. This won't be exactly the same as yours, but it might point someone in the right direction if they're having a similar problem. My problem seemed to be coming from two different sources.</p> <p>First, the <code>message</code> exception property wasn't being set in some of the servlets that were throwing exceptions caught by the error page. The servlets were catching and rethrowing exceptions using the <a href="http://download.oracle.com/javaee/5/api/javax/servlet/ServletException.html#ServletException%28java.lang.Throwable%29" rel="nofollow"><code>ServletException(Throwable rootCause)</code></a> constructor.</p> <p>Second, in the error page itself, the original author had used scriptlet code to parse the message using <code>String.split(message, ";");</code> Since the message was <code>null</code> this failed. I was getting a <code>NullPointerException</code> in my error log, along with the message "Problem occurred while serving the error page."</p> <p>These two things combined to give me a blank page at the URL of the servlet that was throwing the original exception. I fixed my problem by providing my own error message when I rethrow exceptions in my servlets using the <a href="http://download.oracle.com/javaee/5/api/javax/servlet/ServletException.html#ServletException%28java.lang.String,%20java.lang.Throwable%29" rel="nofollow"><code>ServletException(String message, Throwable rootCause)</code></a> constructor, so the error message will no longer be <code>null</code>. I also rewrote the <code>error.jsp</code> page using EL instead of scriptlet code, but that wasn't strictly necessary.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload