6

我正在尝试在 cassandra 上运行一些 JUnit 测试。但我收到以下错误:

[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.

在我更改为 mac mojave 并重新设置所有内容之前,它运行良好。我认为这是与权限相关的问题,可能是JNA?

IDE:IntelliJ Java:采用OpenJDK 11.0.4 JNA:4.2.2

任何形式的帮助将不胜感激!

4

2 回答 2

6

这是macOS 上AdoptOpenJDK jdk-11.0.4+11 中的一个错误的结果,该错误一直持续到 11.2。

它将在 jdk-11.0.4+11.3版本中修复。

如果您等不及新版本,您可以通过降级到 11.0.3+7 来暂时解决

于 2019-08-16T03:14:28.510 回答
1

什么版本的 cassandra 单元?直到 cassandra 4 才支持 java 11 ( https://issues.apache.org/jira/browse/CASSANDRA-9608 ),我认为嵌入式 cassandra 尚未为此设置

于 2019-08-12T19:08:39.080 回答