You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary M. (JIRA)" <ji...@apache.org> on 2014/09/24 22:36:33 UTC

[jira] [Created] (FILEUPLOAD-259) Creating MultiPartRequestWrapper throws java.lang.StackOverflowError

Gary M. created FILEUPLOAD-259:
----------------------------------

             Summary: Creating MultiPartRequestWrapper throws java.lang.StackOverflowError
                 Key: FILEUPLOAD-259
                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-259
             Project: Commons FileUpload
          Issue Type: Bug
    Affects Versions: 1.3.1
            Reporter: Gary M.


We have unit tests that will create a new MultiPartRequestWrapper. Here is a code snippet of this:

    MockHttpServletRequest req = new MockHttpServletRequest();
    // Set request body to HTTP servlet request:
    req.setContent(requestContent.toByteArray());
    // Set content type to HTTP servlet request (important, includes Mime boundary string):
    req.setContentType(multipartRequestEntity.getContentType());    
    LocaleProvider localeProvider = new DefaultLocaleProvider();
    JakartaMultiPartRequest jak = new JakartaMultiPartRequest();
    jak.setMaxSize(String.valueOf(2000));
    File tempDir = new File(TEMP_DIR);
    if (!tempDir.exists()) {
      tempDir.mkdirs();
    }
    return new MultiPartRequestWrapper(jak, req, tempDir.getAbsolutePath(), localeProvider);

When the "return..." statement runs, seconds later the unit tests fail and we see the following in the unit test console:
java.lang.StackOverflowError
	at org.apache.commons.io.IOUtils.closeQuietly(IOUtils.java:60)
	at org.apache.commons.io.IOUtils.closeQuietly(IOUtils.java:60)
	at org.apache.commons.io.IOUtils.closeQuietly(IOUtils.java:60)
     etc,etc,etc. (hundreds of times)

This behavior does not happen with a prior version of commons-fiileupload.  We only see this with version 1.3.1.
Please advise and thank you in advance for your attention on this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)