Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error linking JNA library on AdoptOpenJDK on MacOS

I am trying to run some JUnit tests over cassandra. But I get the following error:

[08/12/19 10:48:40:411](main)([]) INFO  - c.h.c.c.e.EmbeddedCassandra - Starting embedded Cassandra server.
8/12/19 10:48:41:497](main)([]) ERROR - o.a.c.u.NativeLibraryDarwin - Failed to link the C library against JNA. Native methods will be unavailable.
java.lang.UnsatisfiedLinkError: /private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp: dlopen(/private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp, 1): no suitable image found.  Did find:
    /private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp: code signature in (/private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

It was running well until I changed to mac mojave and re-setup everything. I think it is an issue related to permissions may be or JNA?

IDE: IntelliJ Java: AdoptOpenJDK 11.0.4 JNA: 4.2.2

Any kind of help will be highly appreciated!

like image 637
Pratik Shah Avatar asked Aug 12 '19 18:08

Pratik Shah


2 Answers

This is the result of a bug in AdoptOpenJDK jdk-11.0.4+11 on macOS, persisting through 11.2.

It will be fixed in the jdk-11.0.4+11.3 release.

If you can't wait for the new release you can temporarily resolve by downgrading to 11.0.3+7

like image 196
Daniel Widdis Avatar answered Sep 20 '22 08:09

Daniel Widdis


What version of cassandra unit? Support for java 11 (https://issues.apache.org/jira/browse/CASSANDRA-9608) isn't in until cassandra 4 and I dont think embedded cassandra is setup for that yet

like image 27
Chris Lohfink Avatar answered Sep 22 '22 08:09

Chris Lohfink