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
Thx, I should’ve read the changelog more closely & also understand whats written there… Setting maxPostSize to -1 made my day.
You’re welcome, Jan… 🙂
Post a Comment