6

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!

Daniel Widdis
  • 5,479
  • 7
  • 27
  • 46

2 Answers2

6

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

Daniel Widdis
  • 5,479
  • 7
  • 27
  • 46
1

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

Chris Lohfink
  • 15,442
  • 1
  • 25
  • 37
  • cassandra-driver-version => 3.6.0. This is another weird part - one of my colleague with java11 is able to run the tests just fine. – Pratik Shah Aug 12 '19 at 19:41
  • cassandra driver version isnt same as cassandra version. EmbeddedCassandra actually starts up a full Cassandra instance, pre 4.0 (which isnt released) working on java 11 is pure luck – Chris Lohfink Aug 12 '19 at 19:53
  • it has been working for 2 projects atleast. I feel it is something messed up with my machine :(. They use the same versions, i also checked out their code and tried to run their repos and i see same error. But they do not see any issue at their end when running locally. – Pratik Shah Aug 12 '19 at 20:41