gpt4 book ai didi

spring-boot - Spring Boot v1.4 - 处理多部分/表单数据请求失败。 null] 根本原因是 java.net.SocketTimeoutException : null

转载 作者:可可西里 更新时间:2023-11-01 02:43:20 26 4
gpt4 key购买 nike

我有 1000 台 IOT 设备 不断以小文件(大约 1 Kb)的形式向我的 Spring-Boot 应用程序服务器发送数据。

我总是在特定的时间间隔收到此错误。有人可以指出哪里出了问题吗?

我有 Controller 来上传文件,还有一个TCP套接字

ERROR 37762 --- [io-8080-exec-29] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. null] with root cause

java.net.SocketTimeoutException: null
at org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector.java:201)
at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:235)
at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:216)
at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1212)
at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1163)
at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:742)
at org.apache.coyote.http11.Http11InputBuffer.access$400(Http11InputBuffer.java:38)
at org.apache.coyote.http11.Http11InputBuffer$SocketInputBuffer.doRead(Http11InputBuffer.java:1073)
at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:100)
at org.apache.coyote.http11.Http11InputBuffer.doRead(Http11InputBuffer.java:303)
at org.apache.coyote.Request.doRead(Request.java:511)
at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:318)
at org.apache.tomcat.util.buf.ByteChunk.checkEof(ByteChunk.java:397)
at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:379)
at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:338)
at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:189)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at org.apache.tomcat.util.http.fileupload.util.LimitedInputStream.read(LimitedInputStream.java:132)
at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:946)
at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:850)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at org.apache.tomcat.util.http.fileupload.util.LimitedInputStream.read(LimitedInputStream.java:132)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at org.apache.tomcat.util.http.fileupload.util.Streams.copy(Streams.java:98)
at org.apache.tomcat.util.http.fileupload.util.Streams.copy(Streams.java:68)
at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:293)
at org.apache.catalina.connector.Request.parseParts(Request.java:2792)
at org.apache.catalina.connector.Request.parseParameters(Request.java:3167)
at org.apache.catalina.connector.Request.getParameter(Request.java:1109)
at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:381)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:70)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

最佳答案

防火墙可能会丢弃长时间处于非事件状态的 TCP 连接。一个解决方案是 send TCP keepalives .

还要检查通过防火墙的最大连接量,以及操作系统文件描述符的最大数量是否超过。

关于spring-boot - Spring Boot v1.4 - 处理多部分/表单数据请求失败。 null] 根本原因是 java.net.SocketTimeoutException : null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44428307/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com