Fork me on GitHub

Sunday, April 7, 2013

Fix "Cannot initialize native Snappy library. Compression on new tables will be disabled." with DSC Cassandra 1.2.3 under OS X with Java 1.7

When setting up an OS X 10.8.3 development machine that was already updated to the latest Java 1.7 SDK, I got the following error when starting up DataStax Community Edition Cassandra 1.2.3:

 Googling the error brought me to:   
 To quickly fix the issue, from $CASSADRA_HOME:  
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  at sun.reflect.NativeMethodAccessorImpl.invoke(  
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(  
  at java.lang.reflect.Method.invoke(  
  at org.xerial.snappy.SnappyLoader.loadNativeLibrary(  
  at org.xerial.snappy.SnappyLoader.load(  
  at org.xerial.snappy.Snappy.(  
  at org.apache.cassandra.config.CFMetaData.(  
  at org.apache.cassandra.config.KSMetaData.systemKeyspace(  
  at org.apache.cassandra.config.DatabaseDescriptor.loadYaml(  
  at org.apache.cassandra.config.DatabaseDescriptor.(  
  at org.apache.cassandra.service.CassandraDaemon.setup(  
  at org.apache.cassandra.service.CassandraDaemon.activate(  
  at org.apache.cassandra.service.CassandraDaemon.main(  
 Caused by: java.lang.UnsatisfiedLinkError: no snappyjava in java.library.path  
  at java.lang.ClassLoader.loadLibrary(  
  at java.lang.Runtime.loadLibrary0(  
  at java.lang.System.loadLibrary(  
  at org.xerial.snappy.SnappyNativeLoader.loadLibrary(  
  ... 17 more  
  WARN 15:36:20,720 Cannot initialize native Snappy library. Compression on new tables will be disabled.  

Googling the error brought me to:
...which nicely points out that Snappy 1.0.5 fixes the issue (DSC 1.2.3 ships with snappy-java-

To quickly fix the issue, from $CASSANDRA_HOME:

cd lib
rm snappy-java-

1 comment:

  1. Hi, I tried this solution but with the 1.0.5 snappy lib I have a worse exception which stopped the cassandra startup. Did you that issue to?