HTTPClient 每次请求后都抛出 Error parsing HTTP request header

发布于 2022-09-07 12:23:42 字数 2350 浏览 14 评论 0

HTTPClient 每次请求后都抛出 Error parsing HTTP request header,但是不影响数据返回,网上说是tomcat的问题,但是我这边怎么试都不行,不知道为什么有么有同样问题的兄弟,是怎么解决的

请输入代码
2018-06-14 11:02:24.529 DEBUG 47308 --- [nio-8122-exec-8] o.apache.coyote.http11.Http11Processor   : Error parsing HTTP request header

java.io.EOFException: null
    at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1202)
    at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1149)
    at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:742)
    at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:404)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:667)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:724)

2018-06-14 11:02:24.529 DEBUG 47308 --- [nio-8122-exec-8] o.apache.coyote.http11.Http11Processor   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1875e8c:org.apache.tomcat.util.net.NioChannel@1e924f9:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8122 remote=/127.0.0.1:55761]], Status in: [OPEN_READ], State out: [CLOSED]
2018-06-14 11:02:24.529 DEBUG 47308 --- [nio-8122-exec-8] o.apache.tomcat.util.threads.LimitLatch  : Counting down[http-nio-8122-exec-8] latch=1
2018-06-14 11:02:40.207 DEBUG 47308 --- [8122-Acceptor-0] o.apache.tomcat.util.threads.LimitLatch  : Counting up[http-nio-8122-Acceptor-0] latch=1
2018-06-14 11:02:40.207 DEBUG 47308 --- [nio-8122-exec-9] o.a.coyote.http11.Http11InputBuffer      : Received [POST /lpay HTTP/1.1
Content-Type: application/json
charset: utf-8
accept: */*

clipboard.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

巡山小妖精 2022-09-14 12:23:42

用了NIO吗?会不会是因为nio的某个tunnel没有close啊

感受沵的脚步 2022-09-14 12:23:42

哥们我想跟您请教一下这个问题。我被这个问题困扰了半个月了。各种解决方法都用过,还是报错。请问您是怎么解决的。。

箹锭⒈辈孓 2022-09-14 12:23:42

题主解决了没,我们也遇到类似的问题

method是POST的请求但是 body中没有参数
method为GET的没有报错
method为POST body不为空也没报错

是不是因为解析POST的参数时,流已经到达末尾了

20:12:54.838 ucenter-api-provider [http-nio-11005-exec-1] DEBUG o.a.coyote.http11.Http11InputBuffer - Received [POST /roleUser/judgeRoleUser?userId=10939910&constantId=118&schoolId=1173 HTTP/1.1
Accept: */*
User-Agent: Java/1.8.0_242
Host: 10.105.217.45:11005
Connection: keep-alive

]
20:12:54.846 ucenter-api-provider [http-nio-11005-exec-1] DEBUG o.a.coyote.http11.Http11Processor - Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@d4de3c1:org.apache.tomcat.util.net.NioChannel@2bb197fd:java.nio.channels.SocketChannel[connected local=/10.105.217.45:11005 remote=/10.105.217.45:54516]], Status in: [OPEN_READ], State out: [OPEN]
20:12:54.846 ucenter-api-provider [http-nio-11005-exec-1] DEBUG o.a.coyote.http11.Http11NioProtocol - Pushed Processor [org.apache.coyote.http11.Http11Processor@81dcaf2]
20:12:59.869 ucenter-api-provider [http-nio-11005-exec-2] DEBUG o.a.coyote.http11.Http11NioProtocol - Processing socket [org.apache.tomcat.util.net.NioChannel@2bb197fd:java.nio.channels.SocketChannel[connected local=/10.105.217.45:11005 remote=/10.105.217.45:54516]] with status [OPEN_READ]
20:12:59.869 ucenter-api-provider [http-nio-11005-exec-2] DEBUG o.a.coyote.http11.Http11NioProtocol - Found processor [null] for socket [org.apache.tomcat.util.net.NioChannel@2bb197fd:java.nio.channels.SocketChannel[connected local=/10.105.217.45:11005 remote=/10.105.217.45:54516]]
20:12:59.869 ucenter-api-provider [http-nio-11005-exec-2] DEBUG o.a.coyote.http11.Http11NioProtocol - Popped processor [org.apache.coyote.http11.Http11Processor@81dcaf2] from cache
20:12:59.870 ucenter-api-provider [http-nio-11005-exec-2] DEBUG o.a.coyote.http11.Http11Processor - Error parsing HTTP request header
java.io.EOFException: null
    at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1250)
    at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1190)
    at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:717)
    at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:366)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:687)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    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)
还给你自由 2022-09-14 12:23:42

哥们,你那个 Error parsing HTTP request header java.io.EOFException: null
的错误解决了吗?可有好的解决方案,目前我猜测到的是http&https之间的转换问题

伤痕我心 2022-09-14 12:23:42

我也遇到同样的问题!每次请求完后,都会有这个错误!不知道什么原因

2019-07-15 11:24:44,766 [DEBUG] [http-nio-8698-exec-10] AbstractProtocol$ConnectionHandler - Found processor [null] for socket [org.apache.tomcat.util.net.NioChannel@328ef2b:java.nio.channels.SocketChannel[connected local=/192.168.30.37:8698 remote=/172.16.100.83:41828]]
2019-07-15 11:24:44,766 [DEBUG] [http-nio-8698-exec-10] AbstractProtocol$ConnectionHandler - Popped processor [org.apache.coyote.http11.Http11Processor@3b1f046e] from cache
2019-07-15 11:24:44,766 [DEBUG] [http-nio-8698-exec-10] SocketWrapperBase - Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1c39cdf0:org.apache.tomcat.util.net.NioChannel@328ef2b:java.nio.channels.SocketChannel[connected local=/192.168.30.37:8698 remote=/172.16.100.83:41828]], Read from buffer: [0]
2019-07-15 11:24:44,767 [DEBUG] [http-nio-8698-exec-10] Http11Processor - Error parsing HTTP request header
java.io.EOFException
    at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1289)
    at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1223)
    at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:729)
    at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:368)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:684)
    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: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:745)
2019-07-15 11:24:44,768 [DEBUG] [http-nio-8698-exec-10] AbstractProcessorLight - Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@1c39cdf0:org.apache.tomcat.util.net.NioChannel@328ef2b:java.nio.channels.SocketChannel[connected local=/192.168.30.37:8698 remote=/172.16.100.83:41828]], Status in: [OPEN_READ], State out: [CLOSED]
2019-07-15 11:24:44,768 [DEBUG] [http-nio-8698-exec-10] AbstractProtocol$ConnectionHandler - Pushed Processor [org.apache.coyote.http11.Http11Processor@3b1f046e]
2019-07-15 11:24:44,768 [DEBUG] [http-nio-8698-exec-10] LimitLatch - Counting down[http-nio-8698-exec-10] latch=1
2019-07-15 11:24:44,769 [DEBUG] [http-nio-8698-exec-10] NioEndpoint - Socket: [org.apache.tomcat.util.net.NioChannel@328ef2b:java.nio.channels.SocketChannel[closed]] closed
2019-07-15 11:24:49.421 INFO  com.netflix.discovery.shared.resolver.aws.ConfigClusterResolver -  Resolving eureka endpoints via configuration
2019-07-15 11:25:31,493 [DEBUG] [ContainerBackgroundProcessor[StandardEngine[Tomcat]]] ManagerBase - Start expire sessions StandardManager at 1563161131493 sessioncount 0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文