Upgrading to Tomcat 8.0.24

July 15, 2015 by Michael

If you upgrade your Tomcat installation to 8.0.24, released on July 6th, and all your POST requests suddenly starts to fail, check

 maxPostSize

of your connectors.

The Tomcat team actually fixed it’s behavior:

The meaning of the value zero for the maxPostSize has also been changed to mean a limit of zero rather than no limit to align it with maxSavePostSize and to be more intuitive

The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than zero. If not specified, this attribute is set to 2097152 (2 megabytes).

I had a 0 (zero) in it… That means absolutely no post data. If the setting makes sense or not is irrelevant, it’s correct that way. So, if you’re post requests fail and you wanted to disable the maximum post size, set it to -1.

Ah, and by the way, since Tomcat 8 you can drop the spring-instrument-tomcat module and the stanza in context.xml:

<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/>

Tomcat 8 supports load-time weaving of aspects out of the box and for me, having that module on the class path and using the Spring provided class loader, weaving didn’t work.

2 comments

  1. Jan Rusch wrote:

    Thx, I should’ve read the changelog more closely & also understand whats written there… Setting maxPostSize to -1 made my day.

    Posted on September 4, 2015 at 10:41 AM | Permalink
  2. Michael wrote:

    You’re welcome, Jan… 🙂

    Posted on September 4, 2015 at 10:42 AM | Permalink
Post a Comment

Your email is never published. We need your name and email address only for verifying a legitimate comment. For more information, a copy of your saved data or a request to delete any data under this address, please send a short notice to michael@simons.ac from the address you used to comment on this entry.
By entering and submitting a comment, wether with or without name or email address, you'll agree that all data you have entered including your IP address will be checked and stored for a limited time by Automattic Inc., 60 29th Street #343, San Francisco, CA 94110-4929, USA. only for the purpose of avoiding spam. You can deny further storage of your data by sending an email to support@wordpress.com, with subject “Deletion of Data stored by Akismet”.
Required fields are marked *