本文主要是介绍tomcat org.apache.coyote.http11.HeadersTooLargeException异常处理,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
tomcat报下面错误:
16-Jul-2020 09:07:39.431 严重 [http-nio-8083-exec-11] org.apache.coyote.http11.Http11Processor.service Error processing requestorg.apache.coyote.http11.HeadersTooLargeException: An attempt was made to write more data to the response headers than there was room available in the buffer. Increase maxHttpHeaderSize on the connector or write less data into the response headers.at org.apache.coyote.http11.Http11OutputBuffer.checkLengthBeforeWrite(Http11OutputBuffer.java:481)at org.apache.coyote.http11.Http11OutputBuffer.write(Http11OutputBuffer.java:434)at org.apache.coyote.http11.Http11OutputBuffer.write(Http11OutputBuffer.java:420)at org.apache.coyote.http11.Http11OutputBuffer.sendHeader(Http11OutputBuffer.java:380)at org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:990)at org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:258)at org.apache.coyote.Response.action(Response.java:167)at org.apache.coyote.http11.Http11OutputBuffer.doWrite(Http11OutputBuffer.java:195)at org.apache.coyote.Response.doWrite(Response.java:500)at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:337)at org.apache.catalina.connector.OutputBuffer.flushByteBuffer(OutputBuffer.java:794)at org.apache.catalina.connector.OutputBuffer.realWriteChars(OutputBuffer.java:442)at org.apache.catalina.connector.OutputBuffer.flushCharBuffer(OutputBuffer.java:799)at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:231)at org.apache.catalina.connector.Response.finishResponse(Response.java:477)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379)at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:495)at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:767)at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1347)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)
解决办法:根据错误org.apache.coyote.http11.HeadersTooLargeException可以看出请求头数据超出;
我们可以在tomcat中加maxHttpHeaderSize =“102400” 这一句,如下图
这篇关于tomcat org.apache.coyote.http11.HeadersTooLargeException异常处理的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!