运行tomcat时,本以为成功了
结果,突然出现这两个错误
org.apache.coyote.http11.Http11Processor.service 解析 HTTP 请求 header 错误注意:HTTP请求解析错误的进一步发生将记录在DEBUG级别。
java.lang.IllegalArgumentException: 在方法名称中发现无效的字符串, HTTP 方法名必须是有效的符号.
查了一早上,才解决,下面给大家说一下解决方法
解决:进入tomcat --> conf--> server.xml,找到此文件,用记事本打开。找到以下代码,大概在69行
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="utf-8"
<!-- A "Connector" using the shared thread pool-->
修改为:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="utf-8"
relaxedPathChars="|{}[],%"
relaxedQueryChars="|{}[],%"/>
<!-- A "Connector" using the shared thread pool-->
然后就好啦!!大家快试试吧