java.net.SocketTimeoutException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Timeout Exception in Jersey
    via Stack Overflow by Sander Smith
    ,
  • When a client on a subway ride tries to PUT a http request to a Spring Web application, it may happen, that the request takes really long and finally runs into timeouts. If this happens while Spring Web tries to resolve a Method Handler Argument, an Exception will be thrown, that will never be caught again. {code} java.net.SocketTimeoutException: null at org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector.java:202) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:251) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:232) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.http11.InternalNioInputBuffer.fill(InternalNioInputBuffer.java:133) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.http11.InternalNioInputBuffer$SocketInputBuffer.doRead(InternalNioInputBuffer.java:177) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:110) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.http11.AbstractInputBuffer.doRead(AbstractInputBuffer.java:413) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.Request.doRead(Request.java:460) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:338) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:363) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.connector.InputBuffer.readByte(InputBuffer.java:352) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:94) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at java.io.FilterInputStream.read(FilterInputStream.java:83) ~[na:1.8.0_25] at java.io.PushbackInputStream.read(PushbackInputStream.java:139) ~[na:1.8.0_25] at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.readWithMessageConverters(RequestResponseBodyMethodProcessor.java:168) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.resolveArgument(RequestResponseBodyMethodProcessor.java:105) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77) ~[spring-web-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:162) ~[spring-web-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:129) ~[spring-web-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:777) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:706) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:879) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.filters.ExpiresFilter.doFilter(ExpiresFilter.java:1201) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [spring-web-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:673) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_25] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_25] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_25] {code} Since Spring Web manages the Stream, it should probably also manage the Exceptions thrown by it. I would suggest to just more or less silently (maybe Log.warn) drop the request since * the handler has not yet been called, so the request is unhandled and therefore no bad side effects should have happened * no response code has yet been sent to the client, so it has no reason to think, that anything usefull has happened to the request.
    via by Benjamin Gehrels,
  • When a client on a subway ride tries to PUT a http request to a Spring Web application, it may happen, that the request takes really long and finally runs into timeouts. If this happens while Spring Web tries to resolve a Method Handler Argument, an Exception will be thrown, that will never be caught again. {code} java.net.SocketTimeoutException: null at org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector.java:202) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:251) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:232) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.http11.InternalNioInputBuffer.fill(InternalNioInputBuffer.java:133) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.http11.InternalNioInputBuffer$SocketInputBuffer.doRead(InternalNioInputBuffer.java:177) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:110) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.http11.AbstractInputBuffer.doRead(AbstractInputBuffer.java:413) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.Request.doRead(Request.java:460) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:338) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:363) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.connector.InputBuffer.readByte(InputBuffer.java:352) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:94) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at java.io.FilterInputStream.read(FilterInputStream.java:83) ~[na:1.8.0_25] at java.io.PushbackInputStream.read(PushbackInputStream.java:139) ~[na:1.8.0_25] at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.readWithMessageConverters(RequestResponseBodyMethodProcessor.java:168) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.resolveArgument(RequestResponseBodyMethodProcessor.java:105) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77) ~[spring-web-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:162) ~[spring-web-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:129) ~[spring-web-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:777) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:706) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:879) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) ~[spring-webmvc-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.filters.ExpiresFilter.doFilter(ExpiresFilter.java:1201) ~[tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [spring-web-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.4.RELEASE.jar!/:4.1.4.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:673) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_25] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_25] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.15.jar!/:8.0.15] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_25] {code} Since Spring Web manages the Stream, it should probably also manage the Exceptions thrown by it. I would suggest to just more or less silently (maybe Log.warn) drop the request since * the handler has not yet been called, so the request is unhandled and therefore no bad side effects should have happened * no response code has yet been sent to the client, so it has no reason to think, that anything usefull has happened to the request.
    via by Benjamin Gehrels,
    • java.net.SocketTimeoutException at org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector.java:202) at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:250) at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:231) at org.apache.coyote.http11.InternalNioInputBuffer.fill(InternalNioInputBuffer.java:133) at org.apache.coyote.http11.InternalNioInputBuffer$SocketInputBuffer.doRead(InternalNioInputBuffer.java:177)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,