4

I can upload files to the server in my application, I use angular in the front-end I'm using this library to upload files ng2-file-upload, and I'm using Spring boot in the backend, for the moment it works fine for files up to 1GB, however for even bigger files I got this exeception while uploading :

Caused by: java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. null
    at org.apache.catalina.connector.Request.parseParts(Request.java:2932) ~[catalina.jar:8.5.31]
    at org.apache.catalina.connector.Request.parseParameters(Request.java:3232) ~[catalina.jar:8.5.31]
    at org.apache.catalina.connector.Request.getParameter(Request.java:1137) ~[catalina.jar:8.5.31]
    at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:381) ~[catalina.jar:8.5.31]
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:75) ~[spring-web-4.3.14.RELEASE.jar:4.3.14.RELEASE]
    ... 35 more
Caused by: org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. null
    at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:297) ~[tomcat-coyote.jar:8.5.31]
    at org.apache.catalina.connector.Request.parseParts(Request.java:2884) ~[catalina.jar:8.5.31]
    at org.apache.catalina.connector.Request.parseParameters(Request.java:3232) ~[catalina.jar:8.5.31]
    at org.apache.catalina.connector.Request.getParameter(Request.java:1137) ~[catalina.jar:8.5.31]
    at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:381) ~[catalina.jar:8.5.31]
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:75) ~[spring-web-4.3.14.RELEASE.jar:4.3.14.RELEASE]
    ... 35 more
Caused by: java.net.SocketTimeoutException
    at org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector.java:201) ~[tomcat-coyote.jar:8.5.31]
    at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:235) ~[tomcat-coyote.jar:8.5.31]
    at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:216) ~[tomcat-coyote.jar:8.5.31]
    at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1250) ~[tomcat-coyote.jar:8.5.31]
    at org.apache.tomcat.util.net.NioEnd

point$NioSocketWrapper.read(NioEndpoint.java:1193) ~[tomcat-coyote.jar:8.5.31]

It's seems that while uploading the server recieved a null request but I'm not sure, can anybody explain this error?

5
  • 1
    Try to set server.connection-timeout=-1 property in application.properties and check if the error appears (-1 means infinite timeout) Commented Oct 8, 2018 at 12:33
  • I tried it but same error, thanks though. Commented Oct 8, 2018 at 13:34
  • Hmmm ... Maybe try check it how it behave on standalone tomcat ? Commented Oct 8, 2018 at 18:25
  • 1
    I redeployed today and it works, strange I'm pretty sure it didn't work yesterday, maybe it takes sometimes before giving effects, anyway can you add it as an answer maybe it can help somebody else. Commented Oct 9, 2018 at 14:07
  • Pretty sure server.connection-timeout only applies to the connection phase. As long as a connection is made within that time, you're good. Other timeouts that might be important here would be read/write timeouts. Commented Feb 22, 2023 at 16:01

2 Answers 2

3

To invastigate this issue you can do following:
1. Add server.connection-timeout=-1 property to application.properties and check if the error appears (-1 means infinite timeout)
2. Try to deploy war on standalone tomcat (as far as i know sometimes it behave diffrent that embedded into springboot)

Sign up to request clarification or add additional context in comments.

Comments

1

in our case, changing application.properties on spring had no effect, the solution was changing tomcat server.xml config, increasing connectionTimeout from 20000 (20 secs):

 <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.