akka アプリケーションを実行しようとすると、次のエラーが発生します。
[ERROR] [06/30/2014 15:58:14.591] [Thread-3] [RemoteActorRefProvider] アドレス検索中のエラー [akka://FooPar0@127.0.0.1:2552] akka.remote.RemoteTransportException: トランスポートがありませんロードされたプロトコル: [akka]、利用可能なプロトコル: [akka.tcp] at akka.remote.Remoting$.localAddressForRemote(Remoting.scala:88) ...
私の sbt プロジェクトには、次の build.sbt があります。
名前:=「FooPar」
バージョン:=「0.1」
scalaVersion:= "2.11.1"
リゾルバー += "タイプセーフ リポジトリ" at " http://repo.typesafe.com/typesafe/releases/ "
resolvers += "Sonatype リリース" at " http://oss.sonatype.org/content/repositories/releases "
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.4"
libraryDependencies += "com.typesafe.akka" %% "akka-remote" % "2.3.4"
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.11.4" % "test"
最後に、アプリケーション用に生成された構成文字列は次のようになります。
akka { actor { provider = "akka.remote.RemoteActorRefProvider" } remote { enabled-transports = ["akka.remote.netty.tcp"] netty.tcp.hostname = "10.126.13.61" netty.tcp.port = 2552 netty.tcp.message-frame-size = 20 MiB //netty.tcp { // write-buffer-high-water-mark = 148000b // send-buffer-size = 148000b // receive-buffer-size = 148000b //} } event-handlers = [] loglevel=WARNING } my-custom-dispatcher { // type = PinnedDispatcher executor = thread-pool-executor # 10 years should be enough // thread-pool-executor.keep-alive-time = 315360000s # note that disabling core timeout altogether doesn't work # until ticket 2856 is fixed thread-pool-executor.allow-core-timeout = off mailbox-type = "akka.dispatch.UnboundedDequeBasedMailbox" }
誰かが問題を見つけるのを手伝ってくれますか? 私はこのガイドに従っていますhttp://doc.akka.io/docs/akka/2.3.4/scala/remoting.htmlですが、私の構成ファイルは本来あるべきものと同じようです
マリオへの応答として:
上記の構成文字列から ActorSystem をインスタンス化し、次のコードを使用します。
private var system: Option[ActorSystem] = None
def getSystem(machinefile: String) = synchronized {
system match {
case None =>
system = Some(ActorSystem("FooPar" + indexOf(hostName, machinefile),
ConfigFactory.parseString(conf))); system
case Some(sys) => system
}
}
つまり、Address
オブジェクトを明示的に作成しません。