others - tomcat8 java.lang. IllegalArgumentException: 在方法名称中,发现无效字符 HTTP方法名称必须是标记

在多服务器Apache Tomcat 8环境中部署应用程序时,我经常收到这个错误,它正在阻塞tomcat线程:


INFO [http-nio-80-exec-4461] org.apache.coyote.http11.AbstractHttp11Processor.process Error parsing HTTP request header


 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.


 java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens


 at org.apache.coyote.http11.AbstractNioInputBuffer.parseRequestLine(AbstractNioInputBuffer.java:233)


 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1017)


 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)


 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1524)


 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1480)


 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)


 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)


 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)


 at java.lang.Thread.run(Unknown Source)



我只在多服务器环境中得到这个错误。

我共享了每个页面上嵌入的元标记。


<%


 response.setHeader("Cache-Control","no-cache");


 response.setHeader("Cache-Control","no-store");


 response.setDateHeader("Expires", 0);


 response.setHeader("Pragma","no-cache");


%>



<head>


<meta http-equiv="X-UA-Compatible" content="IE=edge">


<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">


<meta name="viewport" content="width=device-width, initial-scale=1">



我还在几个页面中使用了以下内容,基本上与上面相同:


<meta charset="utf-8">


<meta http-equiv="X-UA-Compatible" content="IE=edge">


<meta name="viewport" content="width=device-width, initial-scale=1">


<meta http-equiv="Expires" content="-1" />


<meta http-equiv="Cache-Control" content="private" />


<meta http-equiv="Cache-Control" content="no-store" />


<meta http-equiv="Pragma" content="no-cache" />



时间:

当你尝试从未启用https的服务器上,使用客户端执行https请求时,会发生此异常,当服务器需要原始数据时,客户端将加密请求数据。

在本地测试时,我得到了相同的异常,问题出在我请求中的URL模式。

https:// to http:// in your client url.

...