Problem with Snappy deploying inside immutant

380 views
Skip to first unread message

Ian Eslick

unread,
Sep 30, 2013, 9:04:52 PM9/30/13
to clojure-...@googlegroups.com
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:320) [snappy-java-1.0.5.jar:]
at org.apache.cassandra.io.compress.SnappyCompressor.initialCompressedBufferLength(SnappyCompressor.java:83) [cassandra-all-1.2.10.jar:1.2.10]
at org.apache.cassandra.io.compress.CompressedSequentialWriter.<init>(CompressedSequentialWriter.java:74) [cassandra-all-1.2.10.jar:1.2.10]
at org.apache.cassandra.io.compress.CompressedSequentialWriter.open(CompressedSequentialWriter.java:41) [cassandra-all-1.2.10.jar:1.2.10]
at org.apache.cassandra.io.sstable.SSTableWriter.<init>(SSTableWriter.java:97) [cassandra-all-1.2.10.jar:1.2.10]
at org.apache.cassandra.db.Memtable$FlushRunnable.createFlushWriter(Memtable.java:458) [cassandra-all-1.2.10.jar:1.2.10]
at org.apache.cassandra.db.Memtable$FlushRunnable.writeSortedContents(Memtable.java:406) [cassandra-all-1.2.10.jar:1.2.10]
at org.apache.cassandra.db.Memtable$FlushRunnable.runWith(Memtable.java:389) [cassandra-all-1.2.10.jar:1.2.10]
at org.apache.cassandra.io.util.DiskAwareRunnable.runMayThrow(DiskAwareRunnable.java:48) [cassandra-all-1.2.10.jar:1.2.10]
at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) [cassandra-all-1.2.10.jar:1.2.10]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [classes.jar:1.6.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_51]
at java.lang.Thread.run(Thread.java:680) [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 java.net.URLClassLoader$1.run(URLClassLoader.java:202) [classes.jar:1.6.0_51]
at java.security.AccessController.doPrivileged(Native Method) [classes.jar:1.6.0_51]
at java.net.URLClassLoader.findClass(URLClassLoader.java:190) [classes.jar:1.6.0_51]
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:61) [clojure.jar:]
at java.lang.ClassLoader.loadClass(ClassLoader.java:306) [classes.jar:1.6.0_51]
at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [classes.jar:1.6.0_51]
at java.lang.Class.forName0(Native Method) [classes.jar:1.6.0_51]
at java.lang.Class.forName(Class.java:171) [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

unread,
Oct 1, 2013, 2:56:57 AM10/1/13
to clojure-...@googlegroups.com, 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.

Thanks!
-- 
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 clojure-cassan...@googlegroups.com.
To post to this group, send email to clojure-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure-cassandra/2f1a5a1a-3bb3-40a6-925f-a9bc9612cabd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

eslick

unread,
Oct 1, 2013, 6:26:28 AM10/1/13
to Alex P, clojure-...@googlegroups.com
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,
Ian
signature.asc

Max Penet

unread,
Oct 1, 2013, 12:24:02 PM10/1/13
to clojure-...@googlegroups.com, Alex P
About lz4, it's a known issue see https://issues.apache.org/jira/browse/CASSANDRA-6030

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
Forward
0 new messages