We have been using Tomcat (v7) on OS X for quite some time now and never experienced any problems. However, after updating the OS to High Sierra, the web applications do not work anymore when compression is enabled in the server.xml.
Chrome constantly shows an ERR_CONTENT_DECODING_FAILED (obviously without any content displaying). When compression is switched off, everything works fine. I assume the root of the problem is Apple's upgrade of zlib in High Sierra. Everything was working fine on Sierra. The Tomcat log files look flawless -- there is no mention of any error occurring there.
Does anyone experience the same issue and managed to fix it or knows of a viable workaround without disabling compression?
Also, it would also be helpful if someone can confirm that newer versions of Tomcat do not experience this issue on High Sierra.
Thanks for your help.
This is a bug in how the Java SDK setLevel()
method is implemented. It is reported that compressed data resulting from setting the level is discarded by the SDK. That will result in corrupted compressed data. The fix for the bug can be found here, written by xuemingshen.
Workaround till an actual fix is found for this: turn off compression in your tomcat project's server.xml
configuration.
Workarround/Hack for Windows: Unfortunately I am not familiar with OS X, but I am facing the same problem on Windows and have been able to find a little bit dirty solution for it. The deflate.c error has been fixed in 8u162-ea
, see https://bugs.openjdk.java.net/browse/JDK-8189789
Unfortunately 8u162-ea
may not contain all fixes or is probably not good enough for a production environment.
To fix it under 8u152
, download and install the latest update from http://jdk.java.net/8/
Go to the installation folder (for instance C:\Java\jdk8-162-ea\jre\bin\
) and copy the zip.dll
which contains the fix (see JDK 9 deflate.c fix) and paste it on the same place under the jdk 8u152
.
I hope you can find something similar under OS X.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With