title: How to increase header size limit Tomcat Java
body: <p>Looking at <a href="https://tomcat.apache.org/tomcat-9.0-doc/config/http.html" rel="nofollow noreferrer">https://tomcat.apache.org/tomcat-9.0-doc/config/http.html</a> I see that 8KB is the default limit of Header Size in Tomcat Apache.</p>
  
  <p>The log shows the following when I make a request with headers more than the default 8KB:
  <code>
  Dec 30, 2019 1:59:26 PM org.apache.coyote.http11.Http11Processor service
  INFO: Error parsing HTTP request header
   Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
  java.lang.IllegalArgumentException: Request header is too large
      at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:720)
      at org.apache.coyote.http11.Http11InputBuffer.parseHeader(Http11InputBuffer.java:867)
      at org.apache.coyote.http11.Http11InputBuffer.parseHeaders(Http11InputBuffer.java:563)
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:311)
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:836)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1839)
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:748)
  </code></p>
  
  <p>My Java Project does not have a <code>server.xml</code> inside <code>/webapp/WEB-INF</code>, just the <code>web.xml</code>. I tried to create a <code>server.xml</code> and add the following like said in this <a href="https://serverfault.com/questions/56691/whats-the-maximum-url-length-in-tomcat">thread</a>:
  <code>
  &lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;Connector port="8080" protocol="HTTP/1.1" maxHttpHeaderSize="65536" maxPostSize="4194304"
             URIEncoding="UTF-8"/&gt;//webapp/WEB-INF
  </code></p>
  
  <p>How Can I increase the default size limit? I'd like to set 16KB.</p>
  
  <p>Thanks in advance =)</p>
  
  <p>PS: I am new in Tomcat/Java World, so sorry if I made a horrible mistake =p</p>