【发布时间】:2014-07-18 19:04:26
【问题描述】:
我正在尝试两个远程连接到不同的本地 Akka ActorSystems。我正在使用 Scala 2.11.1 和 Akka 2.3.3。
我的 application.conf 如下所示:
akka {
loglevel = "DEBUG"
actor {
provider = "akka.remote-RemoteActorRefProvider"
}
remote {
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
hostname = "127.0.0.1"
port = 2552
}
}
}
localConf {
akka.remote.netty.tcp.port = 8448
}
remoteConf {
akka.remote.netty.tcp.port = 4224
}
Actor 非常简单。
import akka.actor._
class Consumer extends Actor {
def receive = {
case msg: String => println("Received: " + msg)
}
}
对于我正在使用的远程系统:
import akka.actor._
import com.typesafe.config.ConfigFactory
object RemoteStart extends App {
val config = ConfigFactory.load()
val system = ActorSystem("remoteSystem", config.getConfig("remoteConf").withFalBack(config))
val actor = system.actorOf(Props[Consumer], name = "consumer")
}
最后是我本地系统的代码:
import akka.actor._
import com.typesafe.config.ConfigFactory
object LocalStart extends App {
val config = ConfigFactory.load()
val system = ActorSystem("loaclSystem", config.getConfig("localConf").withFallBack(config))
val actor = system.actorSelection("akka.tcp://remoteSystem@127.0.0.1:4224/user/consumer")
actor ! "test"
}
我希望它会打印出Received: test。但相反,我收到错误消息。但相反,我收到以下错误消息:
java.lang.NoSuchMethodError: akka.actor.ActorSelectionMessage.wildcardFanOut()Z
我错过了什么?
【问题讨论】: