开发者社区> 问答> 正文

java EOF报错 Unexpected EOF read on the socket

[ DEBUG] [2020-12-29 19:33:43] org.springframework.boot.web.filter.OrderedRequestContextFilter -Bound request context to thread: org.apache.catalina.connector.RequestFacade@56a5a5ba

[ DEBUG] [2020-12-29 19:33:43] org.springframework.web.servlet.DispatcherServlet -DispatcherServlet with name 'dispatcherServlet' processing POST request for [/uploadBigFile]

[ DEBUG] [2020-12-29 19:33:43] org.springframework.web.servlet.DispatcherServlet -Could not complete request

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. java.io.EOFException: Unexpected EOF read on the socket

    at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:116)

    at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.<init>(StandardMultipartHttpServletRequest.java:90)

    at org.springframework.web.multipart.support.StandardServletMultipartResolver.resolveMultipart(StandardServletMultipartResolver.java:81)

    at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1104)

    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:936)

    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)

    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)

    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)

    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)

    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110)

    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)

    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)

    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)

    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    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:193)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)

    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)

    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)

    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)

    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)

    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

    at java.lang.Thread.run(Thread.java:748)

Caused by: java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. java.io.EOFException: Unexpected EOF read on the socket

    at org.apache.catalina.connector.Request.parseParts(Request.java:2950)

    at org.apache.catalina.connector.Request.parseParameters(Request.java:3242)

    at org.apache.catalina.connector.Request.getParameter(Request.java:1136)

    at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:381)

    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:84)

    ... 27 common frames omitted

Caused by: org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. java.io.EOFException: Unexpected EOF read on the socket

    at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:297)

    at org.apache.catalina.connector.Request.parseParts(Request.java:2902)

    ... 31 common frames omitted

Caused by: org.apache.catalina.connector.ClientAbortException: java.io.EOFException: Unexpected EOF read on the socket

    at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:348)

    at org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer.java:663)

    at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:370)

    at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:183)

    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:977)

    at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:881)

    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)

    ... 32 common frames omitted

Caused by: java.io.EOFException: Unexpected EOF read on the socket

    at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:734)

    at org.apache.coyote.http11.Http11InputBuffer.access$300(Http11InputBuffer.java:40)

    at org.apache.coyote.http11.Http11InputBuffer$SocketInputBuffer.doRead(Http11InputBuffer.java:1084)

    at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:140)

    at org.apache.coyote.http11.Http11InputBuffer.doRead(Http11InputBuffer.java:263)

    at org.apache.coyote.Request.doRead(Request.java:581)

    at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:344)

    ... 45 common frames omitted

[ DEBUG] [2020-12-29 19:33:43] org.springframework.boot.web.filter.OrderedRequestContextFilter -Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@56a5a5ba

[ ERROR] [2020-12-29 19:33:43] org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[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. java.io.EOFException: Unexpected EOF read on the socket] with root cause

java.io.EOFException: Unexpected EOF read on the socket

    at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:734)

    at org.apache.coyote.http11.Http11InputBuffer.access$300(Http11InputBuffer.java:40)

    at org.apache.coyote.http11.Http11InputBuffer$SocketInputBuffer.doRead(Http11InputBuffer.java:1084)

    at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:140)

    at org.apache.coyote.http11.Http11InputBuffer.doRead(Http11InputBuffer.java:263)

    at org.apache.coyote.Request.doRead(Request.java:581)

    at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:344)

    at org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer.java:663)

    at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:370)

    at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:183)

    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:977)

    at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:881)

    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:2902)

    at org.apache.catalina.connector.Request.parseParameters(Request.java:3242)

    at org.apache.catalina.connector.Request.getParameter(Request.java:1136)

    at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:381)

    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:84)

    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    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:193)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)

    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)

    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)

    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)

    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)

    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

    at java.lang.Thread.run(Thread.java:748)

    

展开
收起
佚名4918 2021-10-19 08:43:22 4368 0
1 条回答
写回答
取消 提交回答
  • 网络规划设计师、敏捷专家、CISP、ITSS服务经理、ACA全科目、ACP4项、ACE、CBP、CDSP、CZTP等。拥有 PRINCE2 Foundation/Practitioner、CCSK、ITIL、ISO27001、PMP等多项国际认证。 专利5+、期刊10+、知识产权师。核心期刊审稿人。

    您好,看起来问题原因,上传文件还没到末尾就被客户端中断,是超出tomcat文件连接时间了,就被跳转。

    可以尝试咋在application.yml配置文件里加上一个tomcat连接时长

    server:
      connection-timeout: 18000000
    
    2021-10-19 09:10:30
    赞同 1 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载