jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
Jetty
  • Jetty
  • JETTY-1506

error-page ignored

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: 8.1.2
  • Fix Version/s: None
  • Component/s: Hightide, Servlet
  • Labels:
    None
  • Environment:
    Linux
  • Number of attachments :
    0

Description

I have webdefault.xml defined to include an error-page, like this:

<error-page>
<location>/error</location>
</error-page>

I have also tried this:

<error-page>
<error-code>500</error-code>
<location>/error</location>
</error-page>

and this:

<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/error</location>
</error-page>

In all three cases, the exception stack trace is displayed in all its beauty, but not exactly what I'm looking for.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Jan Bartel added a comment - 04/Apr/12 6:54 PM

Nils,

I have the following in $JETTY_HOME/etc/webdefaults.xml:

<error-page>
  <error-code>500</error-code>
   <location>/booboo.html</location>
</error-page>

I've made sure my webapp is using the $JETTY-HOME/etc/webdefaults.xml file (which it won't do by default - it will use the one inside jetty-webapp.jar).

Then if hit the following jsp, it generates an error 500 and I see the contents of booboo.html on the browser:

<html><head>
<%@ page import="java.util.Enumeration" %>
</head><body>
<h1>ERRRR</h1>

<%
  if (true)
   throw new ServletException("FOO");
%>
</body></html>

After you've double-checked that you're using the correct webdefault.xml file and the problem still exists, please reply with the way you're trying to generate the error. Is it via a dispatch, for example?

thanks
Jan

Show
Jan Bartel added a comment - 04/Apr/12 6:54 PM Nils, I have the following in $JETTY_HOME/etc/webdefaults.xml: <error-page> <error-code>500</error-code> <location>/booboo.html</location> </error-page> I've made sure my webapp is using the $JETTY-HOME/etc/webdefaults.xml file (which it won't do by default - it will use the one inside jetty-webapp.jar). Then if hit the following jsp, it generates an error 500 and I see the contents of booboo.html on the browser: <html><head> <%@ page import = "java.util.Enumeration" %> </head><body> <h1>ERRRR</h1> <% if ( true ) throw new ServletException( "FOO" ); %> </body></html> After you've double-checked that you're using the correct webdefault.xml file and the problem still exists, please reply with the way you're trying to generate the error. Is it via a dispatch, for example? thanks Jan
Hide
Permalink
Nils added a comment - 04/Apr/12 8:58 PM

Yes, I know it's using the webdefault.xml, because it's picking up other settings I have overwritten in there.

Show
Nils added a comment - 04/Apr/12 8:58 PM Yes, I know it's using the webdefault.xml, because it's picking up other settings I have overwritten in there.
Hide
Permalink
Nils added a comment - 04/Apr/12 9:02 PM

please reply with the way you're trying to generate the error

My /error is another servlet that does a request dispatcher forward to a static html file.

Show
Nils added a comment - 04/Apr/12 9:02 PM please reply with the way you're trying to generate the error My /error is another servlet that does a request dispatcher forward to a static html file.
Hide
Permalink
Jan Bartel added a comment - 05/Apr/12 12:40 AM

Nils,

I did a dispatch forward to a servlet that throws an exception and the custom error page is still picked up.

If you're forwarding to a static html page, how is an error 500 being produced? Can you paste the stack trace and any relevant snippets of code from your app?

Jan

Show
Jan Bartel added a comment - 05/Apr/12 12:40 AM Nils, I did a dispatch forward to a servlet that throws an exception and the custom error page is still picked up. If you're forwarding to a static html page, how is an error 500 being produced? Can you paste the stack trace and any relevant snippets of code from your app? Jan
Hide
Permalink
Nils added a comment - 05/Apr/12 7:21 AM

No, you misunderstand. My normal servlet fails. I've set the error page to /error, which is matched by another servlet that does a request dispatch forward to a static page. This forwarder does not fail.

I've done forwarding to the static page to retain the URL in the browser.

I should mention that there's also a filter involved in the call stack, but that shouldn't matter.

Show
Nils added a comment - 05/Apr/12 7:21 AM No, you misunderstand. My normal servlet fails. I've set the error page to /error, which is matched by another servlet that does a request dispatch forward to a static page. This forwarder does not fail. I've done forwarding to the static page to retain the URL in the browser. I should mention that there's also a filter involved in the call stack, but that shouldn't matter.
Hide
Permalink
Nils added a comment - 05/Apr/12 7:25 AM

I realize now that this is happening on an 8.1.1 installation, and it's unknown to me if it works on 8.1.2.

Show
Nils added a comment - 05/Apr/12 7:25 AM I realize now that this is happening on an 8.1.1 installation, and it's unknown to me if it works on 8.1.2.
Hide
Permalink
Jan Bartel added a comment - 05/Apr/12 5:05 PM

Nils,

If you test 8.1.2 and you still see the problem, please attach a small webapp that is setup to demonstrate the problem.

thanks
Jan

Show
Jan Bartel added a comment - 05/Apr/12 5:05 PM Nils, If you test 8.1.2 and you still see the problem, please attach a small webapp that is setup to demonstrate the problem. thanks Jan
Hide
Permalink
Greg Wilkins added a comment - 05/Apr/12 5:36 PM

Nils,

It would be best if you could put together a sample webapp that demonstrates the problem you are seeing. Trying to describe your setup in text has not been successful as both Jan and I have tried to reproduce but have not.

So rather than us spending our time for free trying to guess what your exact setup is, you could spend a few minutes and put together a test webapp and then we'll be able to quickly act on that.

Note that we have releases scheduled for early next week, so if there is a problem that you can demonstrate to us, then getting us a repro sooner would make a fix in that release a possibility

Show
Greg Wilkins added a comment - 05/Apr/12 5:36 PM Nils, It would be best if you could put together a sample webapp that demonstrates the problem you are seeing. Trying to describe your setup in text has not been successful as both Jan and I have tried to reproduce but have not. So rather than us spending our time for free trying to guess what your exact setup is, you could spend a few minutes and put together a test webapp and then we'll be able to quickly act on that. Note that we have releases scheduled for early next week, so if there is a problem that you can demonstrate to us, then getting us a repro sooner would make a fix in that release a possibility
Hide
Permalink
Nils added a comment - 08/Apr/12 9:47 AM

As I was about to reproduce this, it dawns on me that the exception is not happening in a servlet, but rather in a servlet filter, in the pre-chain phase. I wonder if that's where the bug is to be found then?

Show
Nils added a comment - 08/Apr/12 9:47 AM As I was about to reproduce this, it dawns on me that the exception is not happening in a servlet, but rather in a servlet filter, in the pre-chain phase. I wonder if that's where the bug is to be found then?
Hide
Permalink
Jan Bartel added a comment - 24/May/12 11:04 AM

Nils,

Any progess on this? Do you have a small webapp to reproduce the problem?

Jan

Show
Jan Bartel added a comment - 24/May/12 11:04 AM Nils, Any progess on this? Do you have a small webapp to reproduce the problem? Jan
Hide
Permalink
Nils added a comment - 24/May/12 11:58 AM

I've not been able to reliably pin this one down, and I haven't seen it recently, probably because I haven't been doing active development on it.

Show
Nils added a comment - 24/May/12 11:58 AM I've not been able to reliably pin this one down, and I haven't seen it recently, probably because I haven't been doing active development on it.

People

  • Assignee:
    Jan Bartel
    Reporter:
    Nils
Vote (0)
Watch (2)

Dates

  • Created:
    04/Apr/12 1:25 PM
    Updated:
    24/May/12 11:58 AM
    Resolved:
    24/May/12 11:58 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.