Question

what configuration needs to be tweaked, and where does it live, in order to increase the maximum allowed post size?

Was it helpful?

Solution

Apache Tomcat by default sets a limit on the maximum size of HTTP POST requests it accepts. In Tomcat 5, this limit is set to 2 MB. When you try to upload files larger than 2 MB, this error can occur.

The solution is to reconfigure Tomcat to accept larger POST requests, either by increasing the limit, or by disabling it. This can be done by editing [TOMCAT_DIR]/conf/server.xml. Set the Tomcat configuration parameter maxPostSize for the HTTPConnector to a larger value (in bytes) to increase the limit. Setting it to 0 in will disable the size check. See the Tomcat Configuration Reference for more information.

OTHER TIPS

It will be for others persons, I see you are coupling Apache HTTP and Tomcat (tomcat / mod_jk), in this case edit the Coyote/JK2 AJP 1.3 Connector the same way you do it for the standard connector (Coyote HTTP/1.1), because the AJP1.3 Connector is where Tomcat receive data.

<!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
<Connector port="8009" 
           enableLookups="false" redirectPort="8443" debug="0"
           protocol="AJP/1.3" maxPostSize="0"/>

The root cause of IllegalStateException exception is a java servlet is attempting to write to the output stream after the response has been committed.

Take care that no content is added to the response after redirecting/dispatching request.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top