Jenny Thomas
Jenny Thomas

Reputation: 21

Cassandra 3.0 installation failing with error CassandraDaemon.java:803 - The native library could not be initialized properly

When running Cassandra at the bin folder in the command prompt to start it up, I consistently get the following errors:

WARN [main] 2022-06-21 21:37:33,563 NativeLibraryWindows.java:53 - JNA not found. Native methods will be disabled.

WARN [main] 2022-06-21 21:37:33,563 StartupChecks.java:169 - JMX is not enabled to receive remote connections. Please see cassandra-env.sh for more info.

ERROR [main] 2022-06-21 21:37:33,564 CassandraDaemon.java:803 - The native library could not be initialized properly.

I'm on a Windows 10 64 bit and following every instruction to the letter from this tutorial for installation of Cassandra 3. I've also referred to this video.

I've setup the environment variables JAVA_HOME, CASSANDRA_HOME as expected, checked that the JNA jars are present in the lib folder, everything I could think of (even trying different versions of Java, editing settings on the cassandra-env.sh file)

This is not an entirely new error: I'm seeing mention of it in other versions of Cassandra too on Stack Overflow. But those seem to be because the jna.xx.jar isn't present in the lib folder? In my case, the jar file is present at the expected location. But I'm still seeing this issue.

Strangely enough when I installed Cassandra through Docker it had absolutely no problem in starting up. I wonder why it won't work when done through the scripts!

Upvotes: 2

Views: 1034

Answers (1)

Daniel Widdis
Daniel Widdis

Reputation: 9091

JNA versions in the 4.x range (which are the dependencies of older versions of Cassandra) are dynamically linked to msvcr100.dll. The error message is misleading, but is mentioned in the video you linked starting at about 9:56.

The easiest way to get that dll in your system is to install the Visual C++ Runtime. The latest supported versions can be downloaded from these permalinks:

You shouldn't need to manually include the JNA JAR files in the newest versions; they are downloaded by dependency managers. You might also have success using a 5.X version of JNA with your dependency manager, although that may not be backwards compatible with the older Cassandra version.

Upvotes: 1

Related Questions