首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >类路径错误中的Akka版本错配

类路径错误中的Akka版本错配
EN

Stack Overflow用户
提问于 2017-11-08 07:12:15
回答 1查看 731关注 0票数 0

我使用SBT来设置Akka持久化,但是它失败了,错误是:

代码语言:javascript
复制
    Detected java.lang.NoSuchMethodError error, which MAY be caused by incompatible Akka versions on the classpath. Please note that a given Akka version MUST be the same across all modules of Akka that you are using, e.g. if you use akka-actor [2.5.6 (resolved from current classpath)] all other core Akka modules MUST be of the same version. External projects like Alpakka, Persistence plugins or Akka HTTP etc. have their own version numbers - please make sure you're using a compatible set of libraries.                 
    Uncaught error from thread [TopsActivitiesSystem-akka.actor.default-dispatcher-16]: akka.persistence.Eventsourced.persist$(Lakka/persistence/Eventsourced;Ljava/lang/Object;Lscala/Function1;)V, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for for ActorSystem[TopsActivitiesSystem]
    Detected java.lang.NoSuchMethodError error, which MAY be caused by incompatible Akka versions on the classpath. Please note that a given Akka version MUST be the same across all modules of Akka that you are using, e.g. if you use akka-actor [2.5.6 (resolved from current classpath)] all other core Akka modules MUST be of the same version. External projects like Alpakka, Persistence plugins or Akka HTTP etc. have their own version numbers - please make sure you're using a compatible set of libraries.                 
    Uncaught error from thread [TopsActivitiesSystem-akka.actor.default-dispatcher-3]: akka.persistence.Eventsourced.persist$(Lakka/persistence/Eventsourced;Ljava/lang/Object;Lscala/Function1;)V, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for for ActorSystem[TopsActivitiesSystem]
    java.lang.NoSuchMethodError: akka.persistence.Eventsourced.persist$(Lakka/persistence/Eventsourced;Ljava/lang/Object;Lscala/Function1;)V

我的配置SBT构建文件是:

代码语言:javascript
复制
    scalaVersion := "2.12.4"

    lazy val root = (project in file("."))
    .configs(IntegrationTest)

    def akkaVersion = "2.5.6"
    def akkaHttpVersion = "10.0.10"
    def logbackVersion = "1.2.3"
    def ItAndTest = "it, test"

    libraryDependencies ++= Seq(

    "com.typesafe.akka" %% "akka-actor" % akkaVersion,
    "com.typesafe.akka" %% "akka-stream" % akkaVersion,
    "com.typesafe.akka" %% "akka-cluster" % akkaVersion,
    "com.typesafe.akka" %% "akka-cluster-tools" % akkaVersion,
    "com.typesafe.akka" % "akka-cluster-metrics_2.12" % akkaVersion,
    "com.redmart.fc" %% "fc-capacity-model" % "1.7.0",
    "com.redmart.akka" %% "akka-downing" % "1.1.0",
    "com.jsuereth" %% "scala-arm" % "2.0",
    "com.typesafe" % "config" % "1.3.1",

    "com.typesafe.scala-logging" %% "scala-logging" % "3.7.2",
    "com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
    "ch.qos.logback" % "logback-classic" % logbackVersion,
    "ch.qos.logback" % "logback-access" % logbackVersion,
    "net.logstash.logback" % "logstash-logback-encoder" % "4.11",
    "joda-time" % "joda-time" % "2.9.3",

    "com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
    "com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion,
    "com.typesafe.akka" %% "akka-persistence-cassandra" % "0.58",
    //  "com.typesafe.akka" %% "akka-cluster" % akkaVersion,
    //  "com.typesafe.akka" %% "akka-cluster-tools" % akkaVersion,
    "com.lightbend.akka" %% "akka-management-cluster-http" % "0.4",

    //  "org.iq80.leveldb" % "leveldb" % "0.9",
    //  "org.fusesource.leveldbjni" % "leveldbjni-all" % "1.8",
    "io.spray" %% "spray-json" % "1.3.3",
    "com.enragedginger" %% "akka-quartz-scheduler" % "1.6.1-akka-2.5.x",
    //  "com.softwaremill.macwire" %% "macros" % "2.2.2" % "provided",
    //  "com.softwaremill.macwire" %% "util" % "2.2.2",

    "com.esotericsoftware" % "kryo" % "4.0.1",
    "com.github.romix.akka" %% "akka-kryo-serialization" % "0.5.2",

    "com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % ItAndTest,
    "org.scalatest" %% "scalatest" % "3.0.4" % ItAndTest,
    "org.mockito" % "mockito-core" % "2.10.0" % ItAndTest,
    "com.github.dnvriend" %% "akka-persistence-inmemory" % "2.5.1.1" % ItAndTest
    )

    dependencyOverrides += "com.typesafe.akka" %% "akka-actor" % akkaVersion
    dependencyOverrides += "com.typesafe.akka" %% "akka-stream" % akkaVersion
    dependencyOverrides += "com.typesafe.akka" %% "akka-cluster" % akkaVersion
    dependencyOverrides += "com.typesafe.akka" %% "akka-cluster-tools" % akkaVersion
    dependencyOverrides += "com.typesafe.akka" %% "akka-persistence" % akkaVersion
    dependencyOverrides += "com.typesafe.akka" %% "akka-slf4j" % akkaVersion
    dependencyOverrides += "com.typesafe.akka" % "akka-cluster-metrics_2.12" % akkaVersion

有人能解释一下失败的原因吗?我相信我将优先考虑最新的一揽子计划。它是使用依赖覆盖的2.5.6。我使用的是SBT 0.13

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-11-08 11:52:10

使用akka-management-cluster-http的当前版本(0.5)

代码语言:javascript
复制
"com.lightbend.akka" %% "akka-management-cluster-http" % "0.5"

0.4版取决于较早版本的Akka。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47173616

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档