org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly

Oracle Community | visumagic | 6 years ago
  1. 0

    I used this one to write the servlet http://www.servletworld.com/servlet-tutorials/servlet-file-upload-example.html I can successfully upload the file through localhost, however, when I use Jmeter to test the app server using 300 threads, it will report this error: [10:40:23.577] {http--8080-244$1283730842} WebApp[http://localhost:8080/OrderFile] CommonsFileUploadServlet: Error encountered while parsing the request [10:40:23.577] {http--8080-244$1283730842} org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:371) [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126) [10:40:23.577] {http--8080-244$1283730842} at CommonsFileUploadServlet.doPost(CommonsFileUploadServlet.java:66) [10:40:23.577] {http--8080-244$1283730842} at javax.servlet.http.HttpServlet.service(HttpServlet.java:153) [10:40:23.577] {http--8080-244$1283730842} at javax.servlet.http.HttpServlet.service(HttpServlet.java:91) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662) [10:40:23.577] {http--8080-244$1283730842} at java.lang.Thread.run(Thread.java:619) [10:40:23.577] {http--8080-244$1283730842} Caused by: org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:982) [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:886) [10:40:23.577] {http--8080-244$1283730842} at java.io.FilterInputStream.read(FilterInputStream.java:116) [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.util.LimitedInputStream.read(LimitedInputStream.java:125) [10:40:23.577] {http--8080-244$1283730842} at java.io.FilterInputStream.read(FilterInputStream.java:90) [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.util.Streams.copy(Streams.java:96) [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.util.Streams.copy(Streams.java:66) [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:366) [10:40:23.577] {http--8080-244$1283730842} ... 12 more Is it because of the size limit? the uploaded file size is 8KB. Thanks!

    Apache's JIRA Issue Tracker | 5 years ago | tina
    org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly
  2. 0

    I used this one to write the servlet http://www.servletworld.com/servlet-tutorials/servlet-file-upload-example.html I can successfully upload the file through localhost, however, when I use Jmeter to test the app server using 300 threads, it will report this error: [10:40:23.577] {http--8080-244$1283730842} WebApp[http://localhost:8080/OrderFile] CommonsFileUploadServlet: Error encountered while parsing the request [10:40:23.577] {http--8080-244$1283730842} org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:371) [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126) [10:40:23.577] {http--8080-244$1283730842} at CommonsFileUploadServlet.doPost(CommonsFileUploadServlet.java:66) [10:40:23.577] {http--8080-244$1283730842} at javax.servlet.http.HttpServlet.service(HttpServlet.java:153) [10:40:23.577] {http--8080-244$1283730842} at javax.servlet.http.HttpServlet.service(HttpServlet.java:91) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743) [10:40:23.577] {http--8080-244$1283730842} at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662) [10:40:23.577] {http--8080-244$1283730842} at java.lang.Thread.run(Thread.java:619) [10:40:23.577] {http--8080-244$1283730842} Caused by: org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:982) [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:886) [10:40:23.577] {http--8080-244$1283730842} at java.io.FilterInputStream.read(FilterInputStream.java:116) [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.util.LimitedInputStream.read(LimitedInputStream.java:125) [10:40:23.577] {http--8080-244$1283730842} at java.io.FilterInputStream.read(FilterInputStream.java:90) [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.util.Streams.copy(Streams.java:96) [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.util.Streams.copy(Streams.java:66) [10:40:23.577] {http--8080-244$1283730842} at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:366) [10:40:23.577] {http--8080-244$1283730842} ... 12 more Is it because of the size limit? the uploaded file size is 8KB. Thanks!

    Apache's JIRA Issue Tracker | 5 years ago | tina
    org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly
  3. 0

    GrizzlyServiceListener: Interrupting idle Thread: http-thread-pool-8001

    Oracle Community | 6 years ago | visumagic
    org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    apache.commons.fileupload throws MalformedStreamException

    Stack Overflow | 6 years ago | Spiderman
    org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly
  6. 0

    Apache Commons FileUpload problem on Glassfish server

    Stack Overflow | 7 years ago | Maksim
    org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly

    8 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.apache.commons.fileupload.MultipartStream$MalformedStreamException

      Stream ended unexpectedly

      at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable()
    2. Apache Commons FileUpload
      MultipartStream$ItemInputStream.read
      1. org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:982)
      2. org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:886)
      2 frames