title: ClosedChannelException while uploading file greater than 10mb - wildfly 10.1
body: <p>All,</p>
  
  <p>would require your valuable guidance on the below error. I am trying to upload a file with size greater than 10MB. </p>
  
  <p>Server: wildfly 10.1.0 Final
  library for file upload 1.3 (apache commons fileupload)</p>
  
  <p>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</p>
  
  <pre><code> &lt;multipart-config&gt;
                &lt;max-file-size&gt;314572800&lt;/max-file-size&gt;   
                &lt;max-request-size&gt;314572800&lt;/max-request-size&gt;
          &lt;/multipart-config&gt;
  </code></pre>
  
  <p>Stacktrace below</p>
  
  <pre><code>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.&lt;init&gt;(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)
  </code></pre>