Wednesday, December 17, 2014

Error "no snappyjava in java.library.path" when running WSO2 Message Broker 2.2.0 in MAC OS X

The Problem.

When running WSO2 Message Broker 2.2.0 in MAC OS X, you might face the following error on the console.

  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.<clinit>(
  at org.apache.cassandra.config.CFMetaData.<clinit>(
  at org.apache.cassandra.config.KSMetaData.systemKeyspace(
  at org.apache.cassandra.config.DatabaseDescriptor.loadYaml(
  at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(
  at org.apache.cassandra.service.CassandraDaemon.setup(
  at org.apache.cassandra.service.CassandraDaemon.activate(
  at org.wso2.carbon.cassandra.server.CassandraServerController$
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(
... 18 more

How to fix the issue.

1. Go to and clone the git to your mac.
2. Once cloned, check the directory. If there are any files inside "target" folder, delete them. Else continue to next step.
3. Open the terminal to the cloned directory and run the "make" command. It might take some time to build.
4. Once the build is completed, go to the following folder - "target/snappy-1.1.1-Mac-x86_64".
5. There you will see a file with name "libsnappyjava.jnilib".
6. Copy this file to WSO2 MB home directory.
7. Now run "./" in the bin folder.

Hope that fixed your issue !.


  1. Here is a built libsnappyjava.jnilib file.

    Note: built on yosemite, did not check with other versions of mac.