必威体育Betway必威体育官网
当前位置:首页 > IT技术

记一个异常java.io.EOFException: No content to map to Object due to end of input

时间:2019-10-27 06:44:42来源:IT技术作者:seo实验室小编阅读:88次「手机版」
 

eofexception

一个提供rest接口的服务出现了以下的异常:

[WARN ] 2018-04-16 14:10:02,919 --http-nio-8090-exec-9-- [org.jboss.resteasy.core.Exceptionhandler] Failed executing POST /entrepot/query
org.jboss.resteasy.spi.ReaderException: java.io.eofexception: No content to map to Object due to end of input
        at org.jboss.resteasy.core.messageBodyparameterInjector.inject(MessageBodyParameterInjector.java:183) ~[resteasy-jaxrs-3.0.7.final.jar:na]
        at org.jboss.resteasy.core.MethodInjectorImpl.injectarguments(MethodInjectorImpl.java:89) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:112) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:288) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:242) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:229) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356) [resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179) [resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.plugins.server.servlet.ServletcontainerDispatcher.service(ServletContainerDispatcher.java:220) [resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) [resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) [resteasy-jaxrs-3.0.7.Final.jar:na]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.catalina.core.APPlicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.catalina.core.StandardwrapperValve.invoke(StandardWrapperValve.java:219) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.catalina.core.StandardcontextValve.invoke(StandardContextValve.java:106) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.catalina.valves.ERRORReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:534) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.tomcat.util.net.NioEndpoint$socketProcessor.doRun(NioEndpoint.java:1566) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_71]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_71]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.11.jar:8.0.11]
        at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
Caused by: java.io.EOFException: No content to map to Object due to end of input
        at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2775) ~[jackson-mapper-asl-1.9.12.jar:1.9.12]
        at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2718) ~[jackson-mapper-asl-1.9.12.jar:1.9.12]
        at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1923) ~[jackson-mapper-asl-1.9.12.jar:1.9.12]
        at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.readFrom(AbstractReaderInterceptorContext.java:59) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.interception.ServerReaderInterceptorContext.readFrom(ServerReaderInterceptorContext.java:62) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:51) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.aroundReadFrom(GZIPDecodingInterceptor.java:59) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:150) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        ... 32 common frames omitted

ContentType类型是application/json; charset=UTF-8

最后查明问题的原因,有请求调用该接口时没有提供JSON参数,参数部分完全是空的

经过实验,参数部分有值但不是JSON格式时,报的异常和这个不同

文章最后发布于: 2018-04-19 22:10:56

相关阅读

Java集合之一—HashMap

深入浅出学Java——HashMap 哈希表(hash table)也叫散列表,是一种非常重要的数据结构,应用场景及其丰富,许多缓存技术(比如memcached)的

iframe.contentWindow 属性:关于contentWindow和conten

定义和用法 contentDocument 属性能够以 HTML 对象来返回 iframe 中的文档,可以通过所有标准的 DOM 方法来处理被返回的对象。 语

关于Java中map函数的使用

3 import java.util.HashMap; 4 import java.util.Map; 5 6 //map使用方法 7 public class MapDemo { 8 9 public

ExecuteNonQuery(),ExecuteScalar(),ExecuteReader的

转载于http://www.cnblogs.com/asdyzh/p/9741641.html ExecuteNonQuery(),ExecuteScalar(),ExecuteReader的用法-转 using Syste

Modal not found: Can't resolve '@babel/runtime/h

项目用的dva最近从gitlab上down下来npm install之后总报如下错误:./node_modules/history/esm/history.jsModule not found: Can'

分享到:

栏目导航

推荐阅读

热门阅读