0

I have a problem. When I call a post rest api with big data (about 35 megabyte in body) this exception is thrown:

org.springframework.web.client.ResourceAccessException: 
     I/O error on POST request for "x": Software caused connection abort: recv failed; 
     nested exception is java.net.SocketException: 
     Software caused connection abort: recv failed

I am using wildfly web server and set maxPostSize=250961630, but it is not working.

Can someone help me, please?

Chris
  • 5,109
  • 3
  • 19
  • 40

1 Answers1

1

The problem solved. In Spring boot,you must define multipartConfigElement bean and set value on setMaxFileSize and setMaxRequestSize properties.The code is:

@Bean
public MultipartConfigElement multipartConfigElement()
{
    MultipartConfigFactory factory = new MultipartConfigFactory();
    factory.setMaxFileSize("1000MB");
    factory.setMaxRequestSize("1000MB");
    return factory.createMultipartConfig();
}