Snappy compression doesn't work with JDK7 on Mac OSX

362 views
Skip to first unread message

Robert Wille

unread,
Feb 6, 2014, 3:47:08 PM2/6/14
to java-dri...@lists.datastax.com
I just upgraded from Java6 to Java7. I now get an error saying that I'm missing the JAR that support Snappy compression. I'm using cassandra-driver-core-2.0.0-rc3-SNAPSHOT.jar. Any workarounds?

Thanks in advance

Robert

Sylvain Lebresne

unread,
Feb 7, 2014, 4:29:05 AM2/7/14
to java-dri...@lists.datastax.com
What exact error do you get? And I suppose you have triple checked that the snappy jar is indeed on the classpath (and is version 1.0.5 of snappy) ?

I haven't noticed any particular problem with snappy and java 7 on my linux box, but that could of course be a mac specific problem (and I don't have a mac).


To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

John Sanda

unread,
Feb 7, 2014, 7:55:50 AM2/7/14
to java-dri...@lists.datastax.com
There was/is a Mac specific issue[1].

--

- John

Vassilis Bekiaris

unread,
Feb 7, 2014, 8:34:00 AM2/7/14
to java-dri...@lists.datastax.com
Hi John,

considering the github issue you linked, I guess your issue is that snappy cannot locate its native library. Are you getting something like this?

Caused by: java.lang.UnsatisfiedLinkError: no snappyjava in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
    at java.lang.Runtime.loadLibrary0(Runtime.java:845)
    at java.lang.System.loadLibrary(System.java:1084)
    at org.xerial.snappy.SnappyNativeLoader.loadLibrary(SnappyNativeLoader.java:52)

If this is your issue, then start your JVM with options "-Dorg.xerial.snappy.tempdir=~/tmp -Dorg.xerial.snappy.lib.name=libsnappyjava.jnilib".

The first option instructs snappy-java to extract the JNI library to the specified temporary directory ($HOME/tmp); you should choose one in which your user has full control, allowing the native loader to mark the native library as executable. The second option instructs snappy-java to lookup the library by the specified filename, so System.mapLibraryName invocation is skipped; instead the native library is located successfully with the filename specified.

Cheers,

Vassilis
Reply all
Reply to author
Forward
0 new messages