Java 调用具有大数据量的post rest api时引发错误

Java 调用具有大数据量的post rest api时引发错误,java,spring,rest,spring-web,Java,Spring,Rest,Spring Web,我有个问题。当我使用大数据(正文中约35 MB)调用post rest api时,会引发以下异常: 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:

我有个问题。当我使用大数据(正文中约35 MB)调用post rest api时,会引发以下异常:

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
我正在使用wildfly web服务器并将maxPostSize设置为250961630,但它不起作用


谁能帮帮我吗?

问题解决了。在Spring boot中,必须定义multipartConfigElement bean,并设置setMaxFileSize和setMaxRequestSize属性的值。代码为:

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