Я пытаюсь создать актера и развернуть его на порт 1997 моей машины следующим образом:
В application.conf:
akka {
version = "2.0-RC2"
event-handlers = ["akka.event.Logging$DefaultLogger"]
loglevel = "DEBUG"
actor {
provider = "akka.remote.RemoteActorRefProvider"
timeout = 60m
deployment {
/bar {
remote = "akka://Foo@127.0.0.1:1997"
}
}
}
remote {
transport = "akka.remote.netty.NettyRemoteTransport"
}
}
В основном методе:
val system = ActorSystem("Foo")
system.actorOf(Props[BarActor], "bar")
При запуске приложения я получаю следующие ошибки:
[DEBUG] [02/28/2012 18:17:43.917] [Foo-akka.actor.default-dispatcher-2] [RemoteActorRefProvider(null)] [akka://Foo/] Instantiating Remote Actor [akka://Foo@127.0.0.1:1997/remote/Foo@10.36.17.2:2552/user/bar]
[DEBUG] [02/28/2012 18:17:43.933] [Foo-akka.actor.default-dispatcher-2] [RemoteClient(akka://Foo)] Starting remote client connection to [akka://Foo@127.0.0.1:1997|/127.0.0.1]
[ERROR] [02/28/2012 18:17:45.136] [Foo-akka.actor.default-dispatcher-2] [ActorSystem(Foo)] REMOTE: RemoteClientError@akka://Foo@127.0.0.1:1997: Error[java.net.ConnectException:Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:701)
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.connect(NioClientSocketPipelineSink.java:400)
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processSelectedKeys(NioClientSocketPipelineSink.java:362)
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:284)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
]
[ERROR] [02/28/2012 18:17:45.136] [Foo-6] [ActorSystem(Foo)] REMOTE: RemoteClientError@akka://Foo@127.0.0.1:1997: Error[java.net.ConnectException:Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:701)
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.connect(NioClientSocketPipelineSink.java:400)
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processSelectedKeys(NioClientSocketPipelineSink.java:362)
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:284)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
]
[DEBUG] [02/28/2012 18:17:45.152] [Foo-akka.actor.default-dispatcher-2] [akka.serialization.Serialization(akka://Foo)] Using serializer[akka.serialization.JavaSerializer] for message [akka.remote.DaemonMsgCreate]
[ERROR] [02/28/2012 18:17:45.198] [Foo-7] [ActorSystem(Foo)] REMOTE: RemoteClientError@akka://Foo@127.0.0.1:1997: Error[java.nio.channels.ClosedChannelException:null
at org.jboss.netty.channel.socket.nio.NioWorker.cleanUpWriteBuffer(NioWorker.java:637)
at org.jboss.netty.channel.socket.nio.NioWorker.writeFromUserCode(NioWorker.java:364)
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:119)
at org.jboss.netty.channel.Channels.write(Channels.java:626)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:65)
at org.jboss.netty.channel.Channels.write(Channels.java:626)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:65)
at org.jboss.netty.handler.execution.ExecutionHandler.handleDownstream(ExecutionHandler.java:165)
at org.jboss.netty.channel.Channels.write(Channels.java:605)
at org.jboss.netty.channel.Channels.write(Channels.java:572)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:245)
at akka.remote.netty.RemoteClient.send(Client.scala:75)
at akka.remote.netty.RemoteClient.send(Client.scala:62)
at akka.remote.netty.NettyRemoteTransport.send(NettyRemoteSupport.scala:136)
at akka.remote.RemoteActorRef.$bang(RemoteActorRefProvider.scala:247)
at akka.remote.RemoteActorRefProvider.useActorOnNode(RemoteActorRefProvider.scala:202)
at akka.remote.RemoteActorRefProvider.actorOf(RemoteActorRefProvider.scala:173)
at akka.actor.ActorCell._actorOf(ActorCell.scala:237)
at akka.actor.ActorCell.actorOf(ActorCell.scala:254)
at akka.actor.LocalActorRefProvider$Guardian$$anonfun$receive$1.liftedTree1$1(ActorRefProvider.scala:406)
at akka.actor.LocalActorRefProvider$Guardian$$anonfun$receive$1.apply(ActorRefProvider.scala:406)
at akka.actor.LocalActorRefProvider$Guardian$$anonfun$receive$1.apply(ActorRefProvider.scala:404)
at akka.actor.Actor$class.apply(Actor.scala:292)
at akka.actor.LocalActorRefProvider$Guardian.apply(ActorRefProvider.scala:400)
at akka.actor.ActorCell.invoke(ActorCell.scala:489)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:178)
at akka.dispatch.Mailbox.run(Mailbox.scala:160)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:479)
at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259)
at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:997)
at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1495)
at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
]
[WARN] [02/28/2012 18:17:45.198] [Foo-akka.actor.default-dispatcher-2] [ActorSystem(Foo)] REMOTE: RemoteClientWriteFailed@akka://Foo@127.0.0.1:1997: MessageClass[scala.Tuple3] Error[java.nio.channels.ClosedChannelException:null
at org.jboss.netty.channel.socket.nio.NioWorker.cleanUpWriteBuffer(NioWorker.java:637)
at org.jboss.netty.channel.socket.nio.NioWorker.writeFromUserCode(NioWorker.java:364)
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:119)
at org.jboss.netty.channel.Channels.write(Channels.java:626)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:65)
at org.jboss.netty.channel.Channels.write(Channels.java:626)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:65)
at org.jboss.netty.handler.execution.ExecutionHandler.handleDownstream(ExecutionHandler.java:165)
at org.jboss.netty.channel.Channels.write(Channels.java:605)
at org.jboss.netty.channel.Channels.write(Channels.java:572)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:245)
at akka.remote.netty.RemoteClient.send(Client.scala:75)
at akka.remote.netty.RemoteClient.send(Client.scala:62)
at akka.remote.netty.NettyRemoteTransport.send(NettyRemoteSupport.scala:136)
at akka.remote.RemoteActorRef.$bang(RemoteActorRefProvider.scala:247)
at akka.remote.RemoteActorRefProvider.useActorOnNode(RemoteActorRefProvider.scala:202)
at akka.remote.RemoteActorRefProvider.actorOf(RemoteActorRefProvider.scala:173)
at akka.actor.ActorCell._actorOf(ActorCell.scala:237)
at akka.actor.ActorCell.actorOf(ActorCell.scala:254)
at akka.actor.LocalActorRefProvider$Guardian$$anonfun$receive$1.liftedTree1$1(ActorRefProvider.scala:406)
at akka.actor.LocalActorRefProvider$Guardian$$anonfun$receive$1.apply(ActorRefProvider.scala:406)
at akka.actor.LocalActorRefProvider$Guardian$$anonfun$receive$1.apply(ActorRefProvider.scala:404)
at akka.actor.Actor$class.apply(Actor.scala:292)
at akka.actor.LocalActorRefProvider$Guardian.apply(ActorRefProvider.scala:400)
at akka.actor.ActorCell.invoke(ActorCell.scala:489)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:178)
at akka.dispatch.Mailbox.run(Mailbox.scala:160)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:479)
at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259)
at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:997)
at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1495)
at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
]
[DEBUG] [02/28/2012 18:17:45.198] [Foo-akka.actor.default-dispatcher-3] [RemoteClient(akka://Foo)] Shutting down remote client [ActiveRemoteClient@akka://Foo@127.0.0.1:1997]
[INFO] [02/28/2012 18:17:45.198] [Foo-akka.actor.default-dispatcher-3] [ActorSystem(Foo)] REMOTE: RemoteClientShutdown@akka://Foo@127.0.0.1:1997
[DEBUG] [02/28/2012 18:17:45.198] [Foo-akka.actor.default-dispatcher-3] [RemoteClient(akka://Foo)] [ActiveRemoteClient@akka://Foo@127.0.0.1:1997] has been shut down
Я, должно быть, делаю что-то не так, но я просто не вижу, что яделать иначе, чем написано в документации Akka 2.0 RC2.Справка!
Та же проблема возникает, использую ли я подход с использованием файла конфигурации или подход программного развертывания, упомянутый в документе Akka 2.0 RC2.