springboot报错 [io-29001-exec-8] o.apache.coyote.http11.Http11Processor
程序员文章站
2024-02-14 17:23:28
...
- springboot 项目运行一段时间报错
2019-12-08 17:11:37.116 INFO 16380 --- [io-29001-exec-8] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header
Note: further occurrences of HTTP request 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.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:415) ~[tomcat-embed-core-9.0.21.jar!/:9.0.21]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:294) ~[tomcat-embed-core-9.0.21.jar!/:9.0.21]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.21.jar!/:9.0.21]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853) [tomcat-embed-core-9.0.21.jar!/:9.0.21]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) [tomcat-embed-core-9.0.21
解决方法
- Tomcat的header缓冲区大小不够,只需要在server.xml中增加maxHttpHeaderSize字段即可:
<Connector URIEncoding="UTF-8" port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol"
useBodyEncodingForURI="false"
enableLookups="false"
connectionTimeout="20000"
redirectPort="8443" maxHttpHeaderSize="你想要的大小"/>
2.如果是SpringBoot项目,则需要在application.yml文件中,进行如下修改:
server:
port: 项目端口
# 下面这个参数是为解决问题而新增的
tomcat:
max-http-header-size: 8192
可能是因为请求协议不对,需要统一成https或http请求。
非原创仅用于记录bug:原文传送门
上一篇: 前端路由vs后端路由
推荐阅读
-
springboot报错 [io-29001-exec-8] o.apache.coyote.http11.Http11Processor
-
解决springboot上传文件报错:The field XXX exceeds its maximum permitted size of 1048576 bytes
-
通过start.spring.io生成的springboot项目,导入IDE后POM第一行报错
-
Springboot项目因为kackson版本问题启动报错解决方案
-
Springboot 定制报错 thymeleaf页面${exception}获取不到
-
springboot启动feign项目报错:Service id not legal hostnam的解决
-
springboot+mybatis报错找不到实体类的问题
-
IDEA 单元测试报错:Class not found:xxxx springboot
-
详解SpringBoot注册Windows服务和启动报错的原因
-
SpringBoot启动报错Failed to determine a suitable driver class