检测到java.lang.NoSuchMethodError错误,这可能是由类路径上不兼容的Akka版本引起的。

时间:2017-09-13 08:00:29

标签: akka-http

检测到java.lang.NoSuchMethodError错误,这可能是由类路径上不兼容的Akka版本引起的。请注意,给定的Akka版本必须与您使用的所有Akka模块相同,例如:如果你使用akka-actor [2.5.4(从当前类路径解析)]所有其他核心Akka模块必须是相同的版本。 Alpakka,Persistence插件或Akka HTTP等外部项目都有自己的版本号 - 请确保您使用的是兼容的库集。

来自线程[my-system-akka.actor.default-dispatcher-5]的未捕获错误:akka.actor.ActorCell.addFunctionRef(Lscala / Function2;)Lakka / actor / FunctionRef;,从&#39开始关闭JVM ; akka.jvm-出口上致命错误'已为ActorSystem [my-system]启用 java.lang.NoSuchMethodError:akka.actor.ActorCell.addFunctionRef(Lscala / Function2;)Lakka / actor / FunctionRef;     at akka.stream.stage.GraphStageLogic $ StageActor。(GraphStage.scala:142)     at akka.stream.stage.GraphStageLogic.getStageActor(GraphStage.scala:956)     at akka.stream.impl.io.ConnectionSourceStage $$ anon $ 2.preStart(TcpStages.scala:60)     at akka.stream.impl.fusing.GraphInterpreter.init(GraphInterpreter.scala:520)     at akka.stream.impl.fusing.GraphInterpreterShell.init(ActorGraphInterpreter.scala:380)     at akka.stream.impl.fusing.ActorGraphInterpreter.tryInit(ActorGraphInterpreter.scala:538)     at akka.stream.impl.fusing.ActorGraphInterpreter.preStart(ActorGraphInterpreter.scala:586)     at akka.actor.Actor $ class.aroundPreStart(Actor.scala:522)     at akka.stream.impl.fusing.ActorGraphInterpreter.aroundPreStart(ActorGraphInterpreter.scala:529)     at akka.actor.ActorCell.create(ActorCell.scala:591)     at akka.actor.ActorCell.invokeAll $ 1(ActorCell.scala:462)     at akka.actor.ActorCell.systemInvoke(ActorCell.scala:484)     at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)     at akka.dispatch.Mailbox.run(Mailbox.scala:223)     at akka.dispatch.Mailbox.exec(Mailbox.scala:234)     at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)     at akka.dispatch.forkjoin.ForkJoinPool $ WorkQueue.runTask(ForkJoinPool.java:1339)     at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)     at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

1 个答案:

答案 0 :(得分:3)

include transitive dependency on akka-stream
    "com.typesafe.akka" %% "akka-http" % "10.0.10",
    "com.typesafe.akka" %% "akka-actor" % "2.5.4",
    "com.typesafe.akka" %% "akka-stream" % "2.5.4",
    "com.typesafe.akka" %% "akka-http-spray-json" % "10.0.10"