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 nor shared. Required fields are marked *