logo       

[ jetty-Bugs-1031520 ] Incorrect status code after handling by error page: msg#00054

java.jetty.general

Subject: [ jetty-Bugs-1031520 ] Incorrect status code after handling by error page

Bugs item #1031520, was opened at 2004-09-20 20:42
Message generated for change (Comment added) made by gregwilkins
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107322&aid=1031520&group_id=7322

Category: Servlets
Group: None
Status: Open
>Resolution: Fixed
Priority: 5
Submitted By: Jeremy Boynes (jboynes)
Assigned to: Jeremy Boynes (jboynes)
Summary: Incorrect status code after handling by error page

Initial Comment:
If a servlet raises an exception (say in init) which is
handled by an error page, a 200 status code is returned
to the client. Instead 500 should be returned to
indicate a problem occurred.

----------------------------------------------------------------------

>Comment By: Greg Wilkins (gregwilkins)
Date: 2004-09-23 23:34

Message:
Logged In: YES
user_id=44062

OK - I got it now. Jetty should never be converting
arbitrary exceptions into UnavailableExceptions. It is only
a servlet that should generate an UnavailableException.
which is good as I could not wrap the root cause with an
unavailable exception.

Fixed (hopefully) in CVS now.

----------------------------------------------------------------------

Comment By: Jeremy Boynes (jboynes)
Date: 2004-09-23 18:23

Message:
Logged In: YES
user_id=378919

Last try :-)

If the init method throws a ServletException, the
ServletHolder converts this to a permanent
UnavailableException. Instead it should not put this
instance into service but should attempt to reinit on a
subsequent request.

As the servlet is not permanently unavailable then the
server should return 500 not 404.

Attach is a patch that may fix the problem.

----------------------------------------------------------------------

Comment By: Greg Wilkins (gregwilkins)
Date: 2004-09-23 08:55

Message:
Logged In: YES
user_id=44062

fixed again

----------------------------------------------------------------------

Comment By: Jeremy Boynes (jboynes)
Date: 2004-09-22 04:02

Message:
Logged In: YES
user_id=378919

Some other change, maybe for the unwrapping, had made this
revert from 404 to 200.

----------------------------------------------------------------------

Comment By: Jeremy Boynes (jboynes)
Date: 2004-09-21 16:46

Message:
Logged In: YES
user_id=378919

I think due to conflict with #1031543, we are now getting a
404 response rather than the 500 expected. This may be
because we are treating the ServletException from init the
same as a permanent UnavailableException.

----------------------------------------------------------------------

Comment By: Greg Wilkins (gregwilkins)
Date: 2004-09-21 12:36

Message:
Logged In: YES
user_id=44062

Thanks for the test case.

fixed in CVS

----------------------------------------------------------------------

Comment By: Jeremy Boynes (jboynes)
Date: 2004-09-21 06:08

Message:
Logged In: YES
user_id=378919

Attached is a simple maven project that reproduces the
problem. Deploy the war and then run the command line
client; the status code output from the client should be 500
not 200.

----------------------------------------------------------------------

Comment By: Greg Wilkins (gregwilkins)
Date: 2004-09-21 04:51

Message:
Logged In: YES
user_id=44062

Do you know if the test is trying to reset the status code
in the
error page?

I assume so, otherwise I can't reproduce?

I'll proceed by disabling setStatus and perhaps sendError
once and
error has been sent. not sure how sendError should be
handled in and error page???


----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107322&aid=1031520&group_id=7322


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise