Bootstrap FreeKB - Tomcat - Resolve "Error parsing HTTP request header"
Tomcat - Resolve "Error parsing HTTP request header"

Updated:   |  Tomcat articles

"Error parsing HTTP request header" appears in catalina.log.

26-Jul-2022 01:13:52.454 INFO [tomcat-http--27] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
 Note: further occurrences of HTTP header 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(
  at org.apache.coyote.http11.Http11Processor.service(
  at org.apache.coyote.AbstractProcessorLight.process(
  at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(
  at java.util.concurrent.ThreadPoolExecutor.runWorker(
  at java.util.concurrent.ThreadPoolExecutor$
  at org.apache.tomcat.util.threads.TaskThread$


Max HTTP Header Size

Each Tomcat application server has a set amount of memory allocated for HTTP header, in server.xml. In this example, the application server has 12288 bytes of memory allocated for the HTTP header. If server.xml is updated to have some other value set for the maxHttpHeaderSize, the Tomcat application server will need to be restarted for this change to take effect.



Anti Virus

If the app in question is not fronted by a web server and does not produce web content (eg. JSP and HTML pages), anti-virus scans may be the cause of this error. The localhost_access_log.txt may identify an anti-virus scan. In this example, the anti-virus software Qualys was scanning Tomcat and producing the HTTP exceptions.

x.x.x.x - - [dd/mm/yyyy:hh:mm:ss -xxxx] "QUALYS / HTTP/1.1" 405 1134


Usually, anti-virus scans are scheduled to occur at a reoccurring period, such as once every 7 days near the same time period. If you know the schedule for the anit-virus scans, you can check the catalina.log at the same time period in the past. If similar exceptions are found near the same time period, this is further indication of an anti-virus scan as the cause of the HTTP errors.


Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee


Add a Comment

Please enter c634b7 in the box below so that we can be sure you are a human.