我正在尝试从 rest API 下载大型 zip 文件,但得到
org.apache.catalina.connector.ClientAbortException:java.io.IOException:连接被对等方重置。
由于连接关闭 - 下载的 zip 文件已损坏,我无法打开它。我尝试设置超时属性,但没有运气。该服务还具有nginx
api 网关配置。
这是堆栈跟踪:
org.apache.catalina.connector.ClientAbortException: java.io.IOException: Connection reset by peer
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:351) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38]
at org.apache.catalina.connector.OutputBuffer.flushByteBuffer(OutputBuffer.java:776) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38]
at org.apache.catalina.connector.OutputBuffer.append(OutputBuffer.java:681) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38]
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:386) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38]
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:364) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38]
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:96) ~[tomcat-embed-core-9.0.38.jar!/:9.0.38]
at org.springframework.util.StreamUtils.copy(StreamUtils.java:166) ~[spring-core-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
at org.springframework.http.converter.ResourceHttpMessageConverter.writeContent(ResourceHttpMessageConverter.java:137) ~[spring-web-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
at org.springframework.http.converter.ResourceHttpMessageConverter.writeInternal(ResourceHttpMessageConverter.java:129) ~[spring-web-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
at org.springframework.http.converter.ResourceHttpMessageConverter.writeInternal(ResourceHttpMessageConverter.java:45) ~[spring-web-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
at org.springframework.http.converter.AbstractHttpMessageConverter.write(AbstractHttpMessageConverter.java:227) ~[spring-web-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:280) ~[spring-webmvc-5.2.9.RELEASE.jar!/:5.2.9.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor.h
配置文件:
server:
connection-timeout: -1
tomcat :
async-timeout: 60000
connectTimeout: 60000
requestTimeout: 60000
socketTimeout: 60000
这是带有 Tomcat 嵌入式服务器版本 9.0.38 的 Spring。