incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olaf Kock <ok...@abstrakt.de>
Subject Re: Cancel attachment download throws a exception
Date Mon, 26 Nov 2007 15:05:37 GMT
Claudio Miranda schrieb:
> catch( IOException ioe )
> {
> 	//
> 	//  Client dropped the connection or something else happened
> 	//
> 	msg = "Error: " + ioe.getMessage();
> 	log.info("I/O exception during download",ioe);
> 	res.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
> 					msg );
> 	return;
> }
[...]
>     I have no idea if other users are experiencing this behavior, but the
> only issue is log polluting.

Additionally: The line res.sendError causes the IllegalStateException
that you also posted (that is the one polluting the log):

> mortbay.log - Committed before 500 Error: timeout
> java.lang.IllegalStateException: Committed
>         at org.mortbay.jetty.Response.resetBuffer(Response.java:990)

Reason: if the client started the download the http headers are "long
gone" to the client, but res.sendError tries to set the header status
code to 500. I believe tomcat names this error message "Response already
committed". There is absolutely no way, that the internal server error
can be signalled as such in a download that probably started as a "200"
download and was cancelled after the first part has been transmitted.

Therefor you're right: only one line should be logged. The res.sendError
line can do nothing else and should really be removed.

Cheers,
Olaf

Mime
View raw message