简体   繁体   English

HttpMessageNotReadableException:无法读取JSON:读取超时

[英]HttpMessageNotReadableException: Could not read JSON: Read timed out

I operate the API server. 我操作API服务器。
When mobile APP contact to API server, sometimes it occur that exception. 当移动APP与API服务器联系时,有时会发生该异常。
I tried test at test server, but I can't reproduce that. 我尝试在测试服务器上测试,但我无法重现。 (I changed apache and tomcat connection time.) (我改变了apache和tomcat的连接时间。)

What's the problem?? 有什么问题??
How can I solve this problem? 我怎么解决这个问题?


    ERROR Could not read JSON: Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out
org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out
        at org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.readInternal(MappingJacksonHttpMessageConverter.java:125)
        at org.springframework.http.converter.AbstractHttpMessageConverter.read(AbstractHttpMessageConverter.java:153)
        at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.readWithMessageConverters(AbstractMessageConverterMethodArgumentResolver.java:120)
        at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.readWithMessageConverters(AbstractMessageConverterMethodArgumentResolver.java:91)
        at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.resolveArgument(RequestResponseBodyMethodProcessor.java:71)
        at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:75)
        at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:156)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:117)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
        at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:628)
        at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:566)
        at org.apache.jk.common.JkInputStream.receive(JkInputStream.java:200)
        at org.apache.jk.common.JkInputStream.doRead(JkInputStream.java:179)
        at org.apache.coyote.Request.doRead(Request.java:427)
        at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:304)
        at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:419)
        at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:327)
        at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193)
        at org.codehaus.jackson.impl.ByteSourceBootstrapper.ensureLoaded(ByteSourceBootstrapper.java:507)
        at org.codehaus.jackson.impl.ByteSourceBootstrapper.detectEncoding(ByteSourceBootstrapper.java:129)
        at org.codehaus.jackson.impl.ByteSourceBootstrapper.constructParser(ByteSourceBootstrapper.java:224)
        at org.codehaus.jackson.JsonFactory._createJsonParser(JsonFactory.java:785)
        at org.codehaus.jackson.JsonFactory.createJsonParser(JsonFactory.java:561)
        at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1923)
        at org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.readInternal(MappingJacksonHttpMessageConverter.java:122)

The problem is right there in the stack trace: "Read timed out". 问题出现在堆栈跟踪中:“读取超时”。 This means the client stopped sending data to your server for so long that the server gave up and assumed the connection was lost. 这意味着客户端停止向服务器发送数据的时间太长以至于服务器放弃并假设连接丢失。 Then the server could not parse the JSON message because it didn't receive all of it (because it gave up waiting for the client to send the rest). 然后服务器无法解析JSON消息,因为它没有收到所有消息(因为它放弃了等待客户端发送其余消息)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 HttpMessageNotReadableException:无法读取 JSON:使用 Spring 引导和 Android 无法识别的字段 - HttpMessageNotReadableException: Could not read JSON: Unrecognized field using Spring boot and Android HttpMessageNotReadableException:无法读取JSON:无法解析日期值“ I” - HttpMessageNotReadableException: Could not read JSON: Failed to parse Date value 'I' 这个错误是什么'org.springframework.http.converter.HttpMessageNotReadableException:无法读取JSON:无法反序列化实例'是什么意思? - What does this error 'org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Can not deserialize instance' mean? 对Spring MVC控制器的POST结果为“ HttpMessageNotReadableException:无法读取JSON:未找到合适的构造函数” - POST to Spring MVC controller results in “HttpMessageNotReadableException: Could not read JSON: No suitable constructor found” SocketTimeoutException:读取超时 - SocketTimeoutException: Read timed out http.converter.HttpMessageNotReadableException:无法读取文档:无法从START_OBJECT令牌中反序列化java.lang.String实例 - http.converter.HttpMessageNotReadableException: Could not read document: Can not deserialize instance of java.lang.String out of START_OBJECT token SOAP Web 服务读取超时 - SOAP WebServices Read Timed Out nzSQLException读取超时错误 - Read timed out error by nzSQLException JedisConnectionException - 读取超时错误 - JedisConnectionException - Read timed out error java.net.SocketTimeoutException:读取超时 - java.net.SocketTimeoutException: Read timed out
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM