我在玩Akka遥控器。一个使用Akka 2.5.23的简单示例很好用。如果将功能添加到实际的开发项目中,我将面临一个非常奇怪的问题:
Uncaught error from thread [RemoteSystem-akka.remote.default-remote-dispatcher-6]: Receiver class akka.remote.RemoteActorRefProvider does not define or inherit an implementation of the resolved method abstract serializationInformation()Lakka/serialization/Serialization$Information; of interface akka.actor.ActorRefProvider., shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[RemoteSystem]
java.lang.AbstractMethodError: Receiver class akka.remote.RemoteActorRefProvider does not define or inherit an implementation of the resolved method abstract serializationInformation()Lakka/serialization/Serialization$Information; of interface akka.actor.ActorRefProvider.
at akka.serialization.Serialization.serializationInformation(Serialization.scala:166)
at akka.serialization.Serialization.akka$serialization$Serialization$$withTransportInformation(Serialization.scala:172)
at akka.serialization.Serialization.akka$serialization$Serialization$$deserializeByteArray(Serialization.scala:231)
at akka.serialization.Serialization$$anonfun$deserialize$2.apply(Serialization.scala:221)
at scala.util.Try$.apply(Try.scala:192)
at akka.serialization.Serialization.deserialize(Serialization.scala:213)
at akka.remote.MessageSerializer$.deserialize(MessageSerializer.scala:30)
at akka.remote.DefaultMessageDispatcher.payload$lzycompute$1(Endpoint.scala:64)
at akka.remote.DefaultMessageDispatcher.payload$1(Endpoint.scala:64)
at akka.remote.DefaultMessageDispatcher.dispatch(Endpoint.scala:82)
at akka.remote.EndpointReader$$anonfun$receive$2.applyOrElse(Endpoint.scala:982)
at akka.actor.Actor$class.aroundReceive$$$capture(Actor.scala:539)
at akka.actor.Actor$class.aroundReceive(Actor.scala)
at akka.remote.EndpointActor.aroundReceive(Endpoint.scala:446)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:612)
at akka.actor.ActorCell.invoke(ActorCell.scala:581)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:268)
at akka.dispatch.Mailbox.run(Mailbox.scala:229)
at akka.dispatch.Mailbox.exec(Mailbox.scala:241)
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)
我还尝试通过以下配置更改序列化器:
akka {
actor {
provider = remote
serializers {
proto = "akka.remote.serialization.ProtobufSerializer"
kryo = "com.twitter.chill.akka.AkkaSerializer"
}
serialization-bindings {
"java.io.Serializable" = kryo
}
enable-additional-serialization-bindings = on
allow-java-serialization = off
}
remote {
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
hostname = "127.0.0.1"
port = 2552
}
}
}
我仔细检查了所有的Akka罐子是否都使用相同的版本。
任何帮助诊断和解决问题的帮助都受到高度赞赏。
答案 0 :(得分:0)
问题在于Apache Beam引入了Apache Flink,后者依赖于较旧版本的Akka。 Akka的动态扩展加载过程会以静默方式加载旧版本,从而导致崩溃。快速的解决方案是将Akka降级到Apache Flink使用的相同版本。