-
1. Re: Can't use errorPage. Any idea why?
dudoes Aug 28, 2002 11:05 PM (in response to l.g.)Hi,
perhaps you should add :
<%@page errorPage="True%>
at top of your JSP files.
and
"
<error-page>
<error-code>403</error-code>
/default.jsp
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
/error.jsp
</error-page>
<error-page>
<exception-type>java.sql.SQLException</exception-type>
/sqlException.jsp
</error-page>
"
at web.xml
hope you are happy -
2. Re: Can't use errorPage. Any idea why?
l.g. Aug 29, 2002 12:59 PM (in response to l.g.)Thanks for reply,
Yes I'm using <@errorPage="errorPage.jsp"@> and <@isErrorPage="true"@> in error page.
Without <error-page>...</error-page> in web.xml I get error in regular html page, not the errorPage.jsp.
When I add <error-page>...</error-page> I get empty html page and in log file
I see another error (not related to exception I throw from my code):
=======================================================================
java.lang.NullPointerException
at org.apache.jsp.errorPage$jsp._jspService(errorPage$jsp.java:82)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:344)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:313)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:554)
at org.mortbay.jetty.servlet.WebApplicationHandler.handle(WebApplicationHandler.java:199)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1572)
at org.mortbay.http.HttpResponse.sendError(HttpResponse.java:360)
at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:390)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:588)
at org.mortbay.jetty.servlet.WebApplicationHandler.handle(WebApplicationHandler.java:199)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1572)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1522)
at org.mortbay.http.HttpServer.service(HttpServer.java:795)
at org.jboss.jetty.Jetty.service(Jetty.java:531)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:784)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:941)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:799)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:186)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:322)
at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:713)
at java.lang.Thread.run(Thread.java:536)
2002-08-29 20:53:11,498 WARN [org.jboss.jbossweb] WARNING: Error 500 while serving error page for 500
=========================================================================
It's really show-stopper, I can't release this app like this.
Is it Jetty problem or jboss? Or maybe mine :-(
hope you happy
I guess I'm not... -
3. Re: Can't use errorPage. Any idea why?
l.g. Aug 29, 2002 2:14 PM (in response to l.g.)Thanks for reply,
Yes I'm using <@errorPage="errorPage.jsp"@> and <@isErrorPage="true"@> in error page.
Without <error-page>...</error-page> in web.xml I get error in regular html page, not the errorPage.jsp.
When I add <error-page>...</error-page> I get empty html page and in log file
I see another error (not related to exception I throw from my code):
=======================================================================
java.lang.NullPointerException
at org.apache.jsp.errorPage$jsp._jspService(errorPage$jsp.java:82)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:344)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:313)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:554)
at org.mortbay.jetty.servlet.WebApplicationHandler.handle(WebApplicationHandler.java:199)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1572)
at org.mortbay.http.HttpResponse.sendError(HttpResponse.java:360)
at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:390)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:588)
at org.mortbay.jetty.servlet.WebApplicationHandler.handle(WebApplicationHandler.java:199)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1572)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1522)
at org.mortbay.http.HttpServer.service(HttpServer.java:795)
at org.jboss.jetty.Jetty.service(Jetty.java:531)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:784)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:941)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:799)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:186)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:322)
at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:713)
at java.lang.Thread.run(Thread.java:536)
2002-08-29 20:53:11,498 WARN [org.jboss.jbossweb] WARNING: Error 500 while serving error page for 500
=========================================================================
It's really show-stopper, I can't release this app like this.
Is it Jetty problem or jboss? Or maybe mine :-( -
4. Re: Can't use errorPage. Any idea why?
dudoes Aug 30, 2002 12:34 AM (in response to l.g.)Hi, as my understanding:
<@errorPage="errorPage.jsp"@> is used to forward the page error to errorPage.jsp, and
<@isErrorPage="true"@> seems that this JSP file can receive and display Exception information.
so,you should add <@isErrorPage="true"@> to errorPage.jsp,
or it display empty page without Exception info.
if you use <error-page/> tag you not need to add <@errorPage="errorPage.jsp"@> in every jsp, because system can automatically capture all Exception info to forward to error-page file.
in addition, the NullPointerException in log file is from your JSP file,not errorPage.jsp
maybe above is useful. -
5. Re: Can't use errorPage. Any idea why?
l.g. Sep 13, 2002 10:48 AM (in response to l.g.)The problem was using filters. If in filter exception is thrown then errorpage does not triggered by the system,
so I have to manually forward to errorpage. :(