java.lang.IllegalArgumentException: Request header is too large

异常如下:

 java.lang.IllegalArgumentException: Request header is too large
        at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:702)
        at org.apache.coyote.http11.Http11InputBuffer.parseHeader(Http11InputBuffer.java:848)
        at org.apache.coyote.http11.Http11InputBuffer.parseHeaders(Http11InputBuffer.java:561)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:699)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
        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(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)

解决方法:

设置tomcat的配置文件server.xml,添加如下配置(可参考下图):

maxPostSize="-1" maxHttpHeaderSize ="102400"

java.lang.IllegalArgumentException: Request header is too large

猜你喜欢