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

Reply via email to