[ 
http://jira.magnolia-cms.com/browse/MGNLDMS-185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Dertinger updated MGNLDMS-185:
-----------------------------------

    Attachment: DMSDownloadServlet.java.patch

Hi,

I've attached a patch that uses a slightly modified version of the code 
provided by Danilo at MAGNOLIA-3566. It just adds another catch block for 
{{IOException}} then inspects the cause to see if it was a 
{{ClientAbortException}}. Code snippet below just for reference:

{code}
    protected void doGet(HttpServletRequest request, HttpServletResponse 
response) throws ServletException, IOException {
        try {
            process(request, response);
        }
        catch (IOException ioe) {
            Throwable wrappedException = ExceptionUtils.getCause(ioe);
            if (!((wrappedException != null) && 
(StringUtils.equalsIgnoreCase(ioe.getClass().getName(),
                "org.apache.catalina.connector.ClientAbortException")))) {
                // log error message ONLY if it's not a client abort.
                log.error("IOExeption during download", ioe);
            } else {
                log.debug("ClientAbortException during download");
            }
        }
        catch (Exception e) {
            log.error("error during download", e);
        }
    }
{code}

Let me know if you have any questions.

Cheers,
Matt


> DMSDownloadServlet logs error messages on client abort
> ------------------------------------------------------
>
>                 Key: MGNLDMS-185
>                 URL: http://jira.magnolia-cms.com/browse/MGNLDMS-185
>             Project: Magnolia DMS Module
>          Issue Type: Bug
>    Affects Versions: 1.4.3
>         Environment: Tomcat 6.0.26
>            Reporter: Oliver Siegmar
>            Assignee: Philipp Bärfuss
>            Priority: Major
>         Attachments: DMSDownloadServlet.java.patch
>
>
> The DMSDownloadServlet logs error messages on client abort -
> {noformat}
> 2010-05-15 00:00:07,261 ERROR info.magnolia.module.dms.DMSDownloadServlet - 
> error during download
> ClientAbortException:  java.net.SocketException: Connection reset
>         at 
> org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:358)
>         at 
> org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:434)
>         at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349)
>         at 
> org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:381)
>         at 
> org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:370)
>         at 
> org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
>         at 
> info.magnolia.module.dms.DMSDownloadServlet.sendUnCompressed(DMSDownloadServlet.java:124)
>         at 
> info.magnolia.module.dms.DMSDownloadServlet.handleResourceRequest(DMSDownloadServlet.java:109)
>         at 
> info.magnolia.module.dms.DMSDownloadServlet.process(DMSDownloadServlet.java:185)
>         at 
> info.magnolia.module.dms.DMSDownloadServlet.doGet(DMSDownloadServlet.java:75)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>         at 
> info.magnolia.cms.filters.ServletDispatchingFilter.doFilter(ServletDispatchingFilter.java:183)
> ...
> {noformat}
> This has once been fixed in MGNLDMS-106 but we now have a regression - 
> probably due to a exception change in recent tomcat versions. Tomcat (using 
> 6.0.26 here) doesn't throw a SocketException, but a 
> [ClientAbortException|http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/connector/ClientAbortException.html]
>  (which is an IOException).
> I'd suggest to catch the IOException rather then the SocketException in 
> DMSDownloadServlet.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to