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

检测到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;,从'akka.jvm-exit关闭JVM对于ActorSystem [my-system] java.lang.NoSuchMethodError启用-on-fatal-error':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)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) )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) )atkka.dispatch.Mails.Mail中的akka.ispor.Ar响应akka.DailCell.SystemInvoke(ActorCell.scala:484),akka.dispatch.Mails.Mail . (Mailbox.scala:282)at akka.dispatch.Mailbox.run(Mailbox.s) cala: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)

2 years ago

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"