Uploaded image for project: 'Commons FileUpload'
  1. Commons FileUpload
  2. FILEUPLOAD-123

NullPointerException in FileUploadBase.createItem(FileUploadBase.java:500) when no factory was set in FileUpload

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.1
    • Fix Version/s: 1.2
    • Labels:
      None

      Description

      The following code produces a NPE, a more descriptive exception (and exception message) would be helpful.

      ServletFileUpload upload = new ServletFileUpload();
      try {
      List<FileItem> items = upload.parseRequest(request);
      /* ... */
      } catch (Exception e) {
      e.printStackTrace();
      }

      The exception is:
      java.lang.NullPointerException
      at org.apache.commons.fileupload.FileUploadBase.createItem(FileUploadBase.java:500)
      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367)
      at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:116)
      ...

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              struppi David Tanzer

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment