如何解决获取 o.apache.coyote.http11.Http11Processor","message":"Error parsing HTTP request header","stack_trace":"java.io.EOFException
我有一个 Producer 应用程序和一个客户端应用程序。从我的客户端应用程序中,我试图使用我的生产者应用程序的端点 URL。我的两个应用程序都部署在 PCF 环境中。 & 是在 spring boot 上开发的。 但是当来自我的客户端应用程序的请求到达生产者应用程序时,它给出了以下异常:-
"thread":"http-nio-8080-exec-4","logger":"o.apache.coyote.http11.Http11Processor","message":"解析HTTP请求头时出错","stack_trace" :"java.io.EOFException: null\n\tat org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1322)\n\tat org.apache.tomcat.util.net.NioEndpoint $NioSocketWrapper.read(NioEndpoint.java:1232)\n\tat org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:791)\n\tat org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer .java:359)\n\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:261)\n\tat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)\n\ tat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:887)\n\tat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1684)\n\tat org .apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\n\tat java.util.concurr ent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat org.apache.tomcat.util.threads.TaskThread$ WrappingRunnable.run(TaskThread.java:61)\n\tat java.lang.Thread.run(Thread.java:748)\n"}
"thread":"http-nio-8080-exec-4","message":"处理请求时报告错误状态[CLOSE_CONNECTION_NOW]","stack_trace":"java.io.EOFException:null\n\tat org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1322)\n\tat org.apache.tomcat.util .net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1232)\n\tat org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:791)\n\tat org.apache.coyote.http11.Http11InputBuffer .parseRequestLine(Http11InputBuffer.java:359)\n\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:261)\n\tat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65 )\n\tat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:887)\n\tat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1684)\ n\tat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBa se.java:49)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n \tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n\tat java.lang.Thread.run(Thread.java:748)\n"}
我也在下面分享我的生产者和客户端应用程序的代码片段:-
生产者应用程序代码-
@GetMapping(path = "/details") 公共详细信息 getDetails( @RequestParam(value = "from_date",required = false) String inputFromDate,@RequestParam(value = "setl_serv_id",required = false) String inputSetlServId,@RequestParam(value = "open_setl_days",required = false) Long inputOpenSetlDays,@RequestHeader(value = "app-name",required = false) String appName) 抛出 CommonException {}
客户端应用程序代码-
HttpHeaders requestHeaders = new HttpHeaders(); requestHeaders.set("app-name","ABC");
HttpEntity<String> requestEntity = new HttpEntity<String>(requestHeaders);
UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString("/details")
.queryParam("from_date",inputFromDate)
.queryParam("setl_serv_id",inputSetlServId)
.queryParam("open_setl_days",inputOpenSetlDays);
ResponseEntity<String> responseEntity = restTemplate.exchange(uriBuilder.buildAndExpand().toUri(),HttpMethod.GET,requestEntity,String.class);
谁能帮我看看我做错了什么?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。