facebook / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.

Home Page:http://rocksdb.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java.lang.NoClassDefFoundError: Could not initialize class org.rocksdb.RocksDB

Manoj-py opened this issue · comments

Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev

Expected behavior

The rocks db should give any errors and should run properly

Actual behavior

I am trying to run a flink job but i get this error when ever the flink job is intailised in local
i have the dependency in the pom file i have imported it in the project
stilll get this error

in loading the rocksdb.loadlibrary()

code snippet

private transient RocksDB rocksDB;
private final String locationsKeyFormat = "%s-locations";
// private final String startTimeKeyFormat = "%s-locations";

@Override
public void open(Configuration params) throws Exception {
    super.open(params);
    RocksDB.loadLibrary();
    rocksDB = RocksDB.open("");

}

Hello @Manoj-py,

thanks for contacting our community. I think this is not a problem of RocksDB. This error clearly state that JVM(Probably running Apache Flink) can't find class at all. It's clearly Maven dependency issue or Apache Flink Issue.

My bet is that you wrote job, which is executed on computation node which have different class path. It used to be problem with all distributed map-reduce systems(Hadoop, Apache Apark, ...) . You need to pay attention to which code you execute locally with probably maven POM classpath and which code is shipped on computation node where you don't have all the dependencies.

Radek

@rhubner Figured out the issue it was with the JVM in mac os the arm version of jvm is not supporting rocksdb native library
i switched from arm based jvm to x86 based JVM it worked