Ajp invalid message received with signature

For me, the problem was simple. I was sending HTTP requests but the connector was configured with AJP protocol. My connector in server.xml was configured like this:

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>

But when I changed it to this:

<Connector port="8009" protocol="HTTP/1.1" redirectPort="8443"/>

The error went away.

Hopefully that will help someone with this error.


It was found that one of the internal processes was calling that port and sending http requests causing the "Invalid message.." error. So I ended up adding an additional http Connector for those internal processes


This may also happen when buffer sizes are not same at both ends: logs mention invalid AJP message and browser receive 400 error code.

I have fixed the situation with both packetSize on AJP connector and ProxyIOBufferSize in Apache2 configuration.

In Tomcat server.xml:

<Connector protocol="AJP/1.3" port="8009"
   connectionTimeout="20000"
   packetSize="65536"
   proxyName="yourproxy.domain.ltd" proxyPort="80"
   />

In Apache2 mod_proxy_ajp configuration, add the statement ProxyIOBufferSize 65536.