[
https://issues.apache.org/jira/browse/TOMAHAWK-1521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12879661#action_12879661
]
Leonardo Uribe commented on TOMAHAWK-1521:
------------------------------------------
"..........However ... after handling, the FileItemIterator.hasNext() is called
@ line 132, which causes a java.io.Exception ("stream closed") which is caught
@ line 248, wrapped in a FileUploadException and handled at
MultipartRequestWrapper:176. ........."
That's new information. It is not expected to have an exception there. I tested
ServletChacheFileSizeErrorsFileUpload in one file case, but I did not tested it
in more complex situations. In theory, in this case we should return the items
uploaded (maybe we didn't notice the effect when use one file). Fortunately,
the error message is shown correctly but we need to investigate in which
situation this could be reproduced, so I'll let it as open (not much time to
investigate this one for now)
> ExtensionsFilter cacheFileSizeErrors Does Not Work As Advertised
> ----------------------------------------------------------------
>
> Key: TOMAHAWK-1521
> URL: https://issues.apache.org/jira/browse/TOMAHAWK-1521
> Project: MyFaces Tomahawk
> Issue Type: Bug
> Components: File Upload
> Affects Versions: 1.1.9
> Environment: commons-fileupload-1.2.1
> Reporter: JZ
>
> With the extensions filter configured with cacheFileSizeErrors=true and
> uploadMaxFileSize=1M, I get the stacktrace below when uploading a file larger
> than 1M.
> This is NOT the expected stack trace.
> Note that ServletChacheFileSizeErrorsFileUpload is used.
> However, line 108 in that class has a comment which states that the line
> "throws a SizeLimitExceededException (wrapped by a FileUploadIOException) if
> the request is longer than the max size"
> That is not accurrate. The SizeLimitExceededException is NOT, in fact,
> wrapped.
> As a result, ServletChacheFileSizeErrorsFileUpload does not trap exceptions
> at the right level and the SizeLimitExceededException bubbles up to the
> MultipartRequestWrapper (which is the source of the WARN - level stack trace
> below).
> Basically, this behaviour renders the cacheFileSizeErrors property useless.
> Here's the stacktrace:
> 2010-06-15 15:07:57,234 WARN
> org.apache.myfaces.webapp.filter.MultipartRequestWrapper] -
> <SizeLimitExceededException while uploading file.> []
> org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the
> request was rejected because its size (3506126) exceeds the configured
> maximum (1048576)
> at
> org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:914)
> at
> org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331)
> at
> org.apache.myfaces.webapp.filter.servlet.ServletChacheFileSizeErrorsFileUpload.parseRequestCatchingFileSizeErrors(ServletChacheFileSizeErrorsFileUpload.java:108)
> at
> org.apache.myfaces.webapp.filter.MultipartRequestWrapper.parseRequest(MultipartRequestWrapper.java:131)
> at
> org.apache.myfaces.webapp.filter.MultipartRequestWrapper.getParameter(MultipartRequestWrapper.java:274)
> at
> javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:158)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.