当前位置: 代码迷 >> 综合 >> 异常:Invalid character found in method name. HTTP method names must be tokens
  详细解决方案

异常:Invalid character found in method name. HTTP method names must be tokens

热度:56   发布时间:2023-11-22 20:30:45.0

1.异常截图:

59$Q6B67{IS}XWW3`@CFB}N

2.异常内容

java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokensat org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:422)at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:683)at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)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)

3.解决方案

    Tomcat的header缓冲区大小不够,只需要在server.xml中增加maxHttpHeaderSize字段即可

    <Connector port="80" protocol="HTTP/1.1"maxHttpHeaderSize="8192"connectionTimeout="20000"redirectPort="8443" URIEncoding="UTF-8"/>

    

参考地址:https://www.cnblogs.com/softidea/p/6917086.html

  相关解决方案