我正在关注本教程
http://alvinalexander.com/scala/simple-akka-actors-remote-example
我照原样关注它,但我的程序没有运行它给我错误,我对这一行感到困惑:
val remote = context.actorFor("akka://HelloRemoteSystem@127.0.0.1:5150/user/RemoteActor")
我必须写什么来代替“用户”?例如,当我将完整路径写到末尾时:
val remote = context.actorFor("akka://HelloRemoteSystem@127.0.0.1:5150/sw/opt/programs/akka/akkaremoting/RemoteActor")
并运行 hellolocal 和 helloremote 都给我关于查找该地址的演员的错误。
如果我按原样编写代码,它会给我错误 helloremote erros :
[INFO] [10/27/2014 16:06:23.736] [HelloRemoteSystem-akka.actor.default-dispatcher-2] [akka://HelloRemoteSystem/deadLetters] Message [java.lang.String] from Actor[akka://HelloRemoteSystem/user/RemoteActor#911921687] to Actor[akka://HelloRemoteSystem/deadLetters] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
^Csarawaheed@ubuntu:/opt/ifkaar/programs/akka/akkaremoting/helloremote$ sbt run
[info] Loading project definition from /opt/ifkaar/programs/akka/akkaremoting/helloremote/project
[info] Set current project to helloremote (in build file:/opt/ifkaar/programs/akka/akkaremoting/helloremote/)
[info] Running HelloRemote
Remote Actor receive messgage : The remote actor is alive
[INFO] [10/27/2014 17:24:06.136] [HelloRemoteSystem-akka.actor.default-dispatcher-2] [akka://HelloRemoteSystem/deadLetters] Message [java.lang.String] from Actor[akka://HelloRemoteSystem/user/RemoteActor#-792263999] to Actor[akka://HelloRemoteSystem/deadLetters] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
hellolocal 错误:
[INFO] [10/27/2014 16:06:23.736] [HelloRemoteSystem-akka.actor.default-dispatcher-2] [akka://HelloRemoteSystem/deadLetters] Message [java.lang.String] from Actor[akka://HelloRemoteSystem/user/RemoteActor#911921687] to Actor[akka://HelloRemoteSystem/deadLetters] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
^Csarawaheed@ubuntu:/opt/ifkaar/programs/akka/akkaremoting/helloremote$ sbt run
[info] Loading project definition from /opt/ifkaar/programs/akka/akkaremoting/helloremote/project
[info] Set current project to helloremote (in build file:/opt/ifkaar/programs/akka/akkaremoting/helloremote/)
[info] Running HelloRemote
Remote Actor receive messgage : The remote actor is alive
[INFO] [10/27/2014 17:24:06.136] [HelloRemoteSystem-akka.actor.default-dispatcher-2] [akka://HelloRemoteSystem/deadLetters] Message [java.lang.String] from Actor[akka://HelloRemoteSystem/user/RemoteActor#-792263999] to Actor[akka://HelloRemoteSystem/deadLetters] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.