Search code examples
javacassandraignite

Apache Ignite and Cassandra - NoClassDefFoundError


I wish to evaluate the performance gain of using Apache Ignite together with Apache Cassandra. I've built Ignite from source, the default configuration boots fine. Starting from the example in the documentation, I was then trying to set up a basic cluster, but I keep getting java.lang.ClassNotFoundException on the classes used, for example org.apache.ignite.cache.store.cassandra.utils.datasource.DataSource.

I've searched for the class files in the provided jars, ad set ambient variables accordingly (both CLASSPATH and USER_LIBS). Still, Ignite cannot find them. I am using ignite 1.7 and Oracle JDK 1.8.

Any suggestion wuold be really appreciated. Thank you.


UPDATE

I tried to copy the ignite-cassandra folder into the libs folder as suggested in the README file. Tried with and without setting the IGNITE_HOME environment variable, both the bin and src distributions, still the required class cannot be found.


Solution

  • I discovered what was causing the issue. The example provided in the Ignite documentation page has a subtle difference in the package structure of several classes, for example:

    • org.apache.ignite.cache.store.cassandra.datasource.DataSource (the class in the ignite-cassandra.jar)
    • org.apache.ignite.cache.store.cassandra.utils.datasource.DataSource (the class in the example)

    The same applies also for other classes in the example. I do not know if this is due to a refactoring performed on the code which did not propagate through the examples, or simply I used a different version of the documentation in contrast with the one I was running.