我正在尝试创建一个 actor 并将其部署到我的计算机的端口 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://[email protected] /cdn-cgi/l/email-protection: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://[email protected] /cdn-cgi/l/email-protection:1997/remote/[email protected] /cdn-cgi/l/email-protection: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://[email protected] /cdn-cgi/l/email-protection:1997|/127.0.0.1]
[ERROR] [02/28/2012 18:17:45.136] [Foo-akka.actor.default-dispatcher-2] [ActorSystem(Foo)] REMOTE: RemoteClientError@akka://[email protected] /cdn-cgi/l/email-protection: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://[email protected] /cdn-cgi/l/email-protection: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://[email protected] /cdn-cgi/l/email-protection: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://[email protected] /cdn-cgi/l/email-protection: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://[email protected] /cdn-cgi/l/email-protection:1997]
[INFO] [02/28/2012 18:17:45.198] [Foo-akka.actor.default-dispatcher-3] [ActorSystem(Foo)] REMOTE: RemoteClientShutdown@akka://[email protected] /cdn-cgi/l/email-protection:1997
[DEBUG] [02/28/2012 18:17:45.198] [Foo-akka.actor.default-dispatcher-3] [RemoteClient(akka://Foo)] [ActiveRemoteClient@akka://[email protected] /cdn-cgi/l/email-protection:1997] has been shut down
我一定做错了什么,但我只是不明白我所做的与 Akka 2.0 RC2 文档所说的不同。帮助!
无论我使用配置文件方法还是 Akka 2.0 RC2 文档中提到的编程部署方法,都会出现同样的问题。
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)