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

        Hide
        Jan Bartel added a comment -

        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 - 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
        Nils added a comment -

        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 - Yes, I know it's using the webdefault.xml, because it's picking up other settings I have overwritten in there.
        Hide
        Nils added a comment -

        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 - 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
        Jan Bartel added a comment -

        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 - 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
        Nils added a comment -

        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 - 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
        Nils added a comment -

        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 - 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
        Jan Bartel added a comment -

        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 - 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
        Greg Wilkins added a comment -

        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 - 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
        Nils added a comment -

        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 - 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
        Jan Bartel added a comment -

        Nils,

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

        Jan

        Show
        Jan Bartel added a comment - Nils, Any progess on this? Do you have a small webapp to reproduce the problem? Jan
        Hide
        Nils added a comment -

        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 - 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
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: