0 Replies Latest reply on Jul 27, 2017 4:13 AM by Varun Tayur

    ClosedChannelException while uploading file greater than 10mb

    Varun Tayur Newbie

      All,

       

      would require your valuable guidance on the below error. I am trying to upload a file with size greater than 10MB. 

       

      Server: wildfly 10.1.0 Final

      library for file upload 1.3 (apache commons fileupload)

       

      I have tried the following with no success.

      a. changed the max-post-size to a large number 300mb

      b. also added to web.xml the

           <multipart-config>

                    <max-file-size>314572800</max-file-size>   

                    <max-request-size>314572800</max-request-size>

              </multipart-config>

       

      Stacktrace below

      java.nio.channels.ClosedChannelException

      [ERROR] 2017-07-27 08:05:06,586 stderr -        at io.undertow.conduits.ChunkedStreamSourceConduit.read(ChunkedStreamSourceConduit.java:181)

      [ERROR] 2017-07-27 08:05:06,587 stderr -        at org.xnio.conduits.ConduitStreamSourceChannel.read(ConduitStreamSourceChannel.java:127)

      [ERROR] 2017-07-27 08:05:06,587 stderr -        at io.undertow.channels.DetachableStreamSourceChannel.read(DetachableStreamSourceChannel.java:209)

      [ERROR] 2017-07-27 08:05:06,588 stderr -        at io.undertow.server.HttpServerExchange$ReadDispatchChannel.read(HttpServerExchange.java:2265)

      [ERROR] 2017-07-27 08:05:06,588 stderr -        at org.xnio.channels.Channels.readBlocking(Channels.java:294)

      [ERROR] 2017-07-27 08:05:06,589 stderr -        at io.undertow.servlet.spec.ServletInputStreamImpl.readIntoBuffer(ServletInputStreamImpl.java:168)

      [ERROR] 2017-07-27 08:05:06,589 stderr -        at io.undertow.servlet.spec.ServletInputStreamImpl.read(ServletInputStreamImpl.java:144)

      [ERROR] 2017-07-27 08:05:06,590 stderr -        at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:997)

      [ERROR] 2017-07-27 08:05:06,590 stderr -        at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:901)

      [ERROR] 2017-07-27 08:05:06,591 stderr -        at java.io.InputStream.read(InputStream.java:101)

      [ERROR] 2017-07-27 08:05:06,591 stderr -        at org.apache.commons.fileupload.util.Streams.copy(Streams.java:101)

      [ERROR] 2017-07-27 08:05:06,592 stderr -        at org.apache.commons.fileupload.util.Streams.copy(Streams.java:70)

      [ERROR] 2017-07-27 08:05:06,592 stderr -        at org.apache.commons.fileupload.MultipartStream.readBodyData(MultipartStream.java:589)

      [ERROR] 2017-07-27 08:05:06,593 stderr -        at org.apache.commons.fileupload.MultipartStream.discardBodyData(MultipartStream.java:613)

      [ERROR] 2017-07-27 08:05:06,594 stderr -        at org.apache.commons.fileupload.MultipartStream.skipPreamble(MultipartStream.java:630)

      [ERROR] 2017-07-27 08:05:06,594 stderr -        at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:1018)

      [ERROR] 2017-07-27 08:05:06,595 stderr -        at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:998)

      [ERROR] 2017-07-27 08:05:06,595 stderr -        at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:310)

      [ERROR] 2017-07-27 08:05:06,596 stderr -        at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:334)

      [ERROR] 2017-07-27 08:05:06,596 stderr -        at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115)

      [ERROR] 2017-07-27 08:05:06,597 stderr -        at com.xx.yy.zz.servlet.auth.FileUploader.doPost(FileUploader.java:181)

      [ERROR] 2017-07-27 08:05:06,597 stderr -        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

      [ERROR] 2017-07-27 08:05:06,598 stderr -        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)