我已经添加了最新的akka-http到我的项目,但这包括非常老的2.4.19版本的akka-演员。因此,我还在依赖项中添加了akka-参与者版本2.5.4。然而,这会导致以下错误:
Detected java.lang.NoSuchMethodError error, which MAY be caused by incompatible Akka versions on the classpath.我的maven配置如下:
<dependencies>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-http_2.11</artifactId>
<version>10.0.9</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.11</artifactId>
<version>2.5.4</version>
</dependency>
</dependencies>我遗漏了什么?有任何版本的akka-http使用最新的阿克卡演员?
更新:添加依赖关系图

发布于 2017-08-27 13:36:12
来自文档中的兼容性准则页面:
AkkaHTTP10.0.x(二进制)与Akka
2.4.x以及Akka2.5.x兼容,但是为了方便这一点,构建(以及由此发布的工件)依赖于2.4系列。取决于您如何构造依赖项,您可能会遇到依赖于akka-actor的2.5系列,而依赖于来自10.0系列的akka-http的情况,后者反过来会在版本2.4中引入akka-streams依赖项,这将打破所有Akka模块必须具有相同版本的二进制兼容性要求,因此akka-streams依赖项必须是akka-actor的相同版本(所以是来自2.5系列的确切版本)。 为了解决这个依赖问题,您必须显式地依赖于Akka流,并使其与您的Akka环境的其他部分相同.
将Maven依赖项更改为:
<dependencies>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.11</artifactId>
<version>2.5.4</version>
</dependency>
<!-- Explicitly depend on akka-streams in same version as akka-actor -->
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream_2.11</artifactId>
<version>2.5.4</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-http_2.11</artifactId>
<version>10.0.9</version>
</dependency>
</dependencies>https://stackoverflow.com/questions/45903422
复制相似问题