SpringBoot报错(十五)java.lang.IllegalArgumentException: Request header is too large

Springboot的Tomcat报错

Springboot提交数据,直接报错,这种情况一看后台,写了tomcat,就知道是它在搞鬼,错误代码如下

java.lang.IllegalArgumentException: Request header is too large
	at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:701) ~[tomcat-embed-core-8.5.11.jar:8.5.11]
	at org.apache.coyote.http11.Http11InputBuffer.parseHeader(Http11InputBuffer.java:847) ~[tomcat-embed-core-8.5.11.jar:8.5.11]
	at org.apache.coyote.http11.Http11InputBuffer.parseHeaders(Http11InputBuffer.java:560) ~[tomcat-embed-core-8.5.11.jar:8.5.11]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:683) ~[tomcat-embed-core-8.5.11.jar:8.5.11]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.11.jar:8.5.11]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798) [tomcat-embed-core-8.5.11.jar:8.5.11]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434) [tomcat-embed-core-8.5.11.jar:8.5.11]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.11.jar:8.5.11]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.11.jar:8.5.11]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]

这个不管哪种框架使用tomcat都会出现这种问题所以要修改的也必然是tomcat的配置,一是maxHttpPostSize,二是maxHttpHeaderSize这两个的值

Tomcat配置修改


springboot 配置修改

server.max-http-header-size=20971520
server.tomcat.max-http-post-size=20971520
server.tomcat.max-connections=3000
server.tomcat.max-threads=1000

相关Springmvc的错误可以看我另外一篇文章
Tomcat的Request header is too large报错与参数无法上传到后台

你可能感兴趣的:(springboot,tomcat)