Problem with Snappy deploying inside immutant

Skip to first unread message

Ian Eslick

Sep 30, 2013, 9:04:52 PM9/30/13
If I start the embedded Cassandra and connect to it during the startup of a servlet application inside Immutant I get the following error.  Any suggestions?  I recall their being some issues with snappy installing a native driver?

17:52:40,204 INFO  [org.apache.cassandra.db.Memtable] (FlushWriter:2) Writing Memtable-schema_keyspaces@32964493(251/2510 serialized/live bytes, 8 ops)
17:52:40,206 INFO  [org.apache.cassandra.db.Memtable] (FlushWriter:3) Writing Memtable-schema_columns@17017861(21903/219030 serialized/live bytes, 332 ops)
17:52:40,204 ERROR [org.apache.cassandra.service.CassandraDaemon] (FlushWriter:1) Exception in thread Thread[FlushWriter:1,5,main]: java.lang.UnsatisfiedLinkError: org.xerial.snappy.SnappyNative.maxCompressedLength(I)I
at org.xerial.snappy.SnappyNative.maxCompressedLength(Native Method) [snappy-java-1.0.5.jar:]
at org.xerial.snappy.Snappy.maxCompressedLength( [snappy-java-1.0.5.jar:]
at [cassandra-all-1.2.10.jar:1.2.10]
at<init>( [cassandra-all-1.2.10.jar:1.2.10]
at [cassandra-all-1.2.10.jar:1.2.10]
at<init>( [cassandra-all-1.2.10.jar:1.2.10]
at org.apache.cassandra.db.Memtable$FlushRunnable.createFlushWriter( [cassandra-all-1.2.10.jar:1.2.10]
at org.apache.cassandra.db.Memtable$FlushRunnable.writeSortedContents( [cassandra-all-1.2.10.jar:1.2.10]
at org.apache.cassandra.db.Memtable$FlushRunnable.runWith( [cassandra-all-1.2.10.jar:1.2.10]
at [cassandra-all-1.2.10.jar:1.2.10]
at [cassandra-all-1.2.10.jar:1.2.10]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask( [classes.jar:1.6.0_51]
at java.util.concurrent.ThreadPoolExecutor$ [classes.jar:1.6.0_51]
at [classes.jar:1.6.0_51]

Also, if I add cassandra 2.0.1 to my dependencies, I get the following error.  Is there a preferred method to include cassandra 2.0 when running a cassaforte application?

Caused by: java.lang.ClassNotFoundException: org.apache.cassandra.utils.ByteBufferUtil
at$ [classes.jar:1.6.0_51]
at Method) [classes.jar:1.6.0_51]
at [classes.jar:1.6.0_51]
at clojure.lang.DynamicClassLoader.findClass( [clojure.jar:]
at java.lang.ClassLoader.loadClass( [classes.jar:1.6.0_51]
at java.lang.ClassLoader.loadClass( [classes.jar:1.6.0_51]
at java.lang.Class.forName0(Native Method) [classes.jar:1.6.0_51]
at java.lang.Class.forName( [classes.jar:1.6.0_51]
at clojurewerkz.cassaforte.bytes$eval5871$loading__4910__auto____5872.invoke(bytes.clj:1)
at clojurewerkz.cassaforte.bytes$eval5871.invoke(bytes.clj:1)

Alex P

Oct 1, 2013, 2:56:57 AM10/1/13
to, Ian Eslick
Yup, Snappy is missing, you can add it to dependencies: 

[org.xerial.snappy/snappy-java "1.0.5"]

Actually I remember that on some environments (I think it was somehow related to Hadoop but I may be wrong), also Apache Commons Lang was required.

You can use cassandra 2.0 with current Cassaforte without any issues. Including 2.0 jar is a completely different story though. Just switch to Standalone Cassandra, or, if you want, we're always glad to accept a patch that would make it work with 2.0 embedded :) I'll try to find some time to tackle the issue during the second half of month.

Alex P
You received this message because you are subscribed to the Google Groups "Cassaforte, a Clojure client for Apache Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit


Oct 1, 2013, 6:26:28 AM10/1/13
to Alex P,
Actually the problem I was reported stemmed from two things.  First, as you point out, cassaforte is not compatible with the embedded version of Cassandra 2.0 which isn't a huge deal.  Second, snappy did not load properly during redeploys in OSGi containers like JBoss AS7.  

The 1.0.5-M4 version of snappy explicitly patched this problem and 1.1.0 contains a workaround, but does not yet work with the Datastax driver from what I can tell. 

Thank you,

Max Penet

Oct 1, 2013, 12:24:02 PM10/1/13
to, Alex P
About lz4, it's a known issue see

I encountered the same problem on the alpha of alia[1] 2.0 while adding support for c* 2.0, it's possible to have it run but with compression disabled in the meantime or you could build a patched version of the driver with the correct dependencies. 

But running c* 2.0 now is a bit dangerous imho anyway, there are still bugs (for instance the CAS issues jepsen uncovered among others).

Reply all
Reply to author
0 new messages