14 Replies Latest reply on Apr 10, 2018 7:46 AM by thiesw

    java.io.EOFException when using Multipart form-data

    adrian.boangiu

      Hello,

       

      We have migrated an application developed using ADF 12.1.3 and ADF Faces based on Trinidad implementation from JBoss 7.1.1 to Wildfly 10.1.

      In Wildfly 10.1 we have the following exception every time we post a form which allows multipart content:

       

      13:02:46,630 SEVERE [org.apache.myfaces.trinidadinternal.config.upload.FileUploadConfiguratorImpl] (default task-59)  : java.io.EOFException

           at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler._readLine(MultipartFormHandler.java:253) [trinidad-impl.jar:]

           at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler._readLine(MultipartFormHandler.java:237) [trinidad-impl.jar:]

           at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler._skipBoundary(MultipartFormHandler.java:223) [trinidad-impl.jar:]

           at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler.<init>(MultipartFormHandler.java:102) [trinidad-impl.jar:]

           at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler.<init>(MultipartFormHandler.java:75) [trinidad-impl.jar:]

           at org.apache.myfaces.trinidadinternal.config.upload.FileUploadConfiguratorImpl.beginRequest(FileUploadConfiguratorImpl.java:139) [trinidad-impl.jar:]

           at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl._startConfiguratorServiceRequest(GlobalConfiguratorImpl.java:732) [trinidad-impl.jar:]

           at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl.beginRequest(GlobalConfiguratorImpl.java:227) [trinidad-impl.jar:]

           at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:181) [trinidad-impl.jar:]

           at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92) [trinidad-api.jar:]

           at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at com.siveco.jsf.server.filter.SessionFilter.doFilter(SessionFilter.java:207) [JSFServer.jar:]

           at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at com.siveco.server.EncodingFilter.doFilter(EncodingFilter.java:45) [JSFLogin.jar:]

           at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

           at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:53) [undertow-core-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [undertow-core-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:59) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) [undertow-core-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) [undertow-core-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) [undertow-core-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.0.Final.jar:1.4.0.Final]

           at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

           at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.server.handlers.MetricsHandler.handleRequest(MetricsHandler.java:62) [undertow-core-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.core.MetricsChainHandler.handleRequest(MetricsChainHandler.java:59) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.servlet.handlers.ServletInitialHandler$1$1.run(ServletInitialHandler.java:110) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_92]

           at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:107) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202) [undertow-core-1.4.0.Final.jar:1.4.0.Final]

           at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805) [undertow-core-1.4.0.Final.jar:1.4.0.Final]

           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_92]

           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_92]

           at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_92]

       

      The http request headers are in both cases (JBoss/Wildfly):

       

      Accept

      text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

      Accept-Encoding

      gzip, deflate

      Accept-Language

      fr-FR,en-US;q=0.7,en;q=0.3

      Connection

      keep-alive

      Content-Length

      2729

      Content-Type

      multipart/form-data; boundary=---------------------------16200160599501

      Cookie

      JSESSIONID=ZwjjfrGzQLgRmYHYGdI4w6r43aeusR0xqjOaQHLT.siv608

      Host

      localhost:8080

      Referer

      http://localhost:8080/coswin/58393467.xhtml?maxDesktopWidth=1392&maxDesktopHeight=234

      Upgrade-Insecure-Requests

      1

      User-Agent

      Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0 Waterfox/53.0

       

      The http request is in both cases (JBoss/Wildfly):

       

      -----------------------------1374726183875 Content-Disposition: form-data; name="stateID" ad3f0c6 -----------------------------1374726183875 Content-Disposition: form-data; name="stateKey" 58393467 -----------------------------1374726183875 Content-Disposition: form-data; name="childrenStateID" e38acf5a -----------------------------1374726183875 Content-Disposition: form-data; name="masterRowKey" 000100000006313244444444 -----------------------------1374726183875 Content-Disposition: form-data; name="csTrState" false -----------------------------1374726183875 Content-Disposition: form-data; name="ssTrState" false -----------------------------1374726183875 Content-Disposition: form-data; name="toolbar_Table1View_searchStr" -----------------------------1374726183875 Content-Disposition: form-data; name="eyrk19" 12DDDD -----------------------------1374726183875 Content-Disposition: form-data; name="eyrk1b" 1223 -----------------------------1374726183875 Content-Disposition: form-data; name="eyrk36" AAAA -----------------------------1374726183875 Content-Disposition: form-data; name="eyrk1d" -----------------------------1374726183875 Content-Disposition: form-data; name="eyrk1h" -----------------------------1374726183875 Content-Disposition: form-data; name="eyrk1j" -----------------------------1374726183875 Content-Disposition: form-data; name="tyrk34_autoValidateRow" false -----------------------------1374726183875 Content-Disposition: form-data; name="org.apache.myfaces.trinidad.faces.FORM" viewTable -----------------------------1374726183875 Content-Disposition: form-data; name="Adf-Window-Id" w5 -----------------------------1374726183875 Content-Disposition: form-data; name="javax.faces.ViewState" !w6pcljq68 -----------------------------1374726183875 Content-Disposition: form-data; name="action" refreshui -----------------------------1374726183875 Content-Disposition: form-data; name="iterName" Table1View -----------------------------1374726183875 Content-Disposition: form-data; name="sourceName" toolbar_Table1View_refresh_button -----------------------------1374726183875 Content-Disposition: form-data; name="oracle.adf.view.rich.DELTAS" {p0:tyrk34={viewportSize=16}} -----------------------------1374726183875 Content-Disposition: form-data; name="event" toolbar_Table1View_refresh_button -----------------------------1374726183875 Content-Disposition: form-data; name="event.toolbar_Table1View_refresh_button" <m xmlns="http://oracle.com/richClient/comm"><k v="type"><s>action</s></k></m> -----------------------------1374726183875--

      The undertow subsystem is configured as follows:

       

      <subsystem xmlns="urn:jboss:domain:undertow:3.1" statistics-enabled="true">

                  <buffer-cache name="default"/>

                  <server name="default-server">

                      <ajp-listener name="apacheListener" socket-binding="ajp" scheme="http"/>

                      <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true" url-charset="utf-8" />

                      <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>

                      <host name="default-host" alias="localhost">

                          <location name="/" handler="welcome-content"/>

                          <access-log pattern="%h %l %u %t (%r) %s %b %D %I" prefix="access" suffix=".log" predicate="not path-suffix(*.css)"/>

                          <filter-ref name="company-header"/>

                          <filter-ref name="404-handler" predicate="true"/>

                      </host>

                  </server>

                  <servlet-container name="default" allow-non-standard-wrappers="true" use-listener-encoding="true" default-encoding="utf-8">

                      <jsp-config x-powered-by="false"/>

                      <session-cookie http-only="true" secure="true"/>

                      <websockets/>

                  </servlet-container>

       

      We have observed that at the level of the method org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler._skipBoundary:

       

      public MultipartFormHandler(final String type, final InputStream in) throws IOException

      {

      if (!type.startsWith(_MULTIPART_REQUEST_TYPE))

      {

      throw new IllegalStateException(_LOG.getMessage(

      "CONTENT_NOT_MULTIPART_FORM_DATA"));

      }

       

      _boundary = _parseBoundary(type);

      _in = new BufferedInputStream(in);

      _skipBoundary();

      }

       

      the InputStream in contains the full text of the http request in JBoss (and Tomcat) and is empty in Wildfly.

      Can you please tell us if there is something we can do to overturn this error?

      Thank you

        • 1. Re: java.io.EOFException when using Multipart form-data
          ctomc

          it  happens always or just if file is bigger than certain size?

          • 2. Re: java.io.EOFException when using Multipart form-data
            adrian.boangiu

            It happens always with or without file to transfer. All our forms have the possibility to upload files. But when the form is posted even without a file to upload we get the exception.

            • 3. Re: java.io.EOFException when using Multipart form-data
              adrian.boangiu

              In the example I have provided there is no file to upload.

              • 4. Re: java.io.EOFException when using Multipart form-data
                reema.pal

                Did the issue got resolved?  We are facing same error after upgrading to wildfly 10.1.

                • 5. Re: java.io.EOFException when using Multipart form-data
                  jaikiran

                  Reema Pal wrote:

                   

                  Did the issue got resolved? We are facing same error after upgrading to wildfly 10.1.

                  Do you use Apache Trinidad in your application too? Can you add more details including the complete exception stacktrace that you see?

                  • 6. Re: java.io.EOFException when using Multipart form-data
                    reema.pal

                    yes we are using Trinidad 2.1 version. Below is the exception trace-

                     

                     

                    SEVERE [org.apache.myfaces.trinidadinternal.config.upload.FileUploadConfiguratorImpl] (default task-57) : java.io.EOFException

                            at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler._readLine(MultipartFormHandler.java:253)

                            at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler._readLine(MultipartFormHandler.java:237)

                            at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler._skipBoundary(MultipartFormHandler.java:223)

                            at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler.<init>(MultipartFormHandler.java:102)

                            at org.apache.myfaces.trinidadinternal.share.util.MultipartFormHandler.<init>(MultipartFormHandler.java:75)

                            at org.apache.myfaces.trinidadinternal.config.upload.FileUploadConfiguratorImpl.beginRequest(FileUploadConfiguratorImpl.java:139)

                            at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl._startConfiguratorServiceRequest(GlobalConfiguratorImpl.java:746)

                            at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl.beginRequest(GlobalConfiguratorImpl.java:227)

                            at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:181)

                            at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)

                            at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

                            at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

                            at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

                            at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

                            at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

                            at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

                            at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

                            at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

                            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                            at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

                            at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

                            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                            at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

                            at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

                            at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

                            at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

                            at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

                            at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

                            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                            at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

                            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                            at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                            at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)

                    • 7. Re: java.io.EOFException when using Multipart form-data
                      jaikiran

                      This very much looks like an issue within the Trinidad library code. You might have to raise this issue in their user/dev forum/mailing list.

                      • 8. Re: java.io.EOFException when using Multipart form-data
                        reema.pal

                        I do not think it is Trinidad library issue as i have tried using Tomahawk file upload component as well as jboss seam 2.3 [wildfly 10 compatible seam version] file upload component. The component value in all cases is submitted as null.

                        • 9. Re: java.io.EOFException when using Multipart form-data
                          jaikiran

                          jaikiran wrote:

                           

                          This very much looks like an issue within the Trinidad library code.

                          I actually take that back. This may not entirely be Trinidad library's issue. Looking at Trinidad's code and Undertow code, what seems to be happening here is that Undertow, during request authentication (backed by FORM mechanism) parses the multipart form data, request stream and then hands off the request to Trinidad. Trinidad notices that it's a multipart form data and tries to parse it by itself to find uploaded files and since the stream has already been parsed by Undertow, there's nothing left in there, which is what causes this EOFException.

                           

                          Looking at Trinidad's file uploading component code, it does have hooks to skip that processing. What you need to decide is whether you want Trinidad's file upload component to handle your uploads or whether you want Undertow to do it. Right now, there's no formal way to skip this default parsing of the form data in Undertow if FORM based authentication is used, so you might have to disable the file upload component of Trinidad (the details to do that might/should be available in Trinidad's documentation).

                          • 10. Re: java.io.EOFException when using Multipart form-data
                            reema.pal

                            Thank you for your help. Will check the Trinidad documentation and try that.

                            • 11. Re: java.io.EOFException when using Multipart form-data
                              reema.pal

                              You were right. Commenting the Trinidad filter  [which is responsible to handle file upload] in web.xml resolved the issue. However,  not sure if not having this filter will have impact on any other Trinidad component.

                              • 12. Re: java.io.EOFException when using Multipart form-data
                                jaikiran

                                Reema Pal wrote:

                                 

                                However, not sure if not having this filter will have impact on any other Trinidad component.

                                It will actually have an impact on other Trinidad components, based on what I see in the code of that filter.

                                 

                                Given that you and the original poster in this thread seem to indicate this wasn't an issue in previous version of JBoss AS, I would like you see what your application looks like. Does it involve FORM based authentication? Can you attach a sample application which reproduces this and steps to reproduce it?

                                • 13. Re: java.io.EOFException when using Multipart form-data
                                  reema.pal

                                  Yes our app does the form based authentication.  I do notice after removing the Trinidad filter, first thing that started to fail is  where the character encoding is fetched from the request. It started giving the NULLPointer exception. Trinidad filter fetches the encoding from  the header' s "content type"  parameter and sets it in the HttpRequest object. As we have a custom filter in our application, i have added Trinidad's code in our filter [only the part to fetch and set the encoding] and things are working for me.

                                   

                                  The simplest way to reproduce it is to deploy Trinidad's 2.1 component demo application to wildfly 10.1  and access the inputfile component UI.

                                  • 14. Re: java.io.EOFException when using Multipart form-data
                                    thiesw

                                    I have the same problem (JSF 2.3, Trinidad 2.2.1, Tomcat 8.5) and found a solution without removing the whole TrinidadFilter.

                                    I documented it here:  jsf - Trinidad/ADF Faces, file upload, EOFException - Stack Overflow (I hope referencing this external place is okay).