An error may occur when Snappy compression/decompression is enabled although its library is available from the classpath.
java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class org.xerial.snappy.Snappy ... Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.xerial.snappy.Snappy at org.apache.cassandra.io.compress.SnappyCompressor.initialCompressedBufferLength (SnappyCompressor.java:39 )
The native library snappy-188.8.131.52-libsnappyjava.so for Snappy compression is included in the snappy-java-184.108.40.206.jar file. When the JVM initializes the JAR, the library is added to the default temp directory. If the default temp directory is mounted with a noexec option, it results in the above exception.
One solution is to specify a different temp directory that has already been mounted without the noexec option, as follows:
The default cassandra-env.sh looks for the variable and appends to it when starting the JVM.