2012-06-28 11 views
10

Uygulamamı play-2.0.2 sürümüne güncelliyorum. uygulama başlangıçta aşağıdaki kodu ararkenOynatmak için güncelleyin 2.0.2 - Şu an akka uzaktan aktörle kullanılan adres

[error] p.c.ActionInvoker - Failed to bind to: /127.0.0.1:2552 
org.jboss.netty.channel.ChannelException: Failed to bind to: /127.0.0.1:2552 
    at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:298) ~[netty.jar:na] 
    at akka.remote.netty.NettyRemoteServer.start(Server.scala:53) ~[akka-remote-2.0.2.jar:2.0.2] 
    at akka.remote.netty.NettyRemoteTransport.start(NettyRemoteSupport.scala:73) ~[akka-remote-2.0.2.jar:2.0.2] 
    at akka.remote.RemoteActorRefProvider.init(RemoteActorRefProvider.scala:95) ~[akka-remote-2.0.2.jar:2.0.2] 
    at akka.actor.ActorSystemImpl._start(ActorSystem.scala:568) ~[akka-actor.jar:2.0.2] 
    at akka.actor.ActorSystemImpl.start(ActorSystem.scala:575) ~[akka-actor.jar:2.0.2] 
Caused by: java.net.BindException: Address already in use 
    at sun.nio.ch.Net.bind(Native Method) ~[na:1.6.0_33] 
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:126) ~[na:1.6.0_33] 
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) ~[na:1.6.0_33] 
    at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.bind(NioServerSocketPipelineSink.java:140) ~[netty.jar:na] 
    at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleServerSocket(NioServerSocketPipelineSink.java:92) ~[netty.jar:na] 
    at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:66) ~[netty.jar:na] 
[error] a.r.RouterConfig$$anon$1 - Failed to bind to: /127.0.0.1:2552 
org.jboss.netty.channel.ChannelException: Failed to bind to: /127.0.0.1:2552 
    at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:298) ~[netty.jar:na] 
    at akka.remote.netty.NettyRemoteServer.start(Server.scala:53) ~[akka-remote-2.0.2.jar:2.0.2] 
    at akka.remote.netty.NettyRemoteTransport.start(NettyRemoteSupport.scala:73) ~[akka-remote-2.0.2.jar:2.0.2] 
    at akka.remote.RemoteActorRefProvider.init(RemoteActorRefProvider.scala:95) ~[akka-remote-2.0.2.jar:2.0.2] 
    at akka.actor.ActorSystemImpl._start(ActorSystem.scala:568) ~[akka-actor.jar:2.0.2] 
    at akka.actor.ActorSystemImpl.start(ActorSystem.scala:575) ~[akka-actor.jar:2.0.2] 
Caused by: java.net.BindException: Address already in use 
    at sun.nio.ch.Net.bind(Native Method) ~[na:1.6.0_33] 
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:126) ~[na:1.6.0_33] 
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) ~[na:1.6.0_33] 
    at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.bind(NioServerSocketPipelineSink.java:140) ~[netty.jar:na] 
    at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleServerSocket(NioServerSocketPipelineSink.java:92) ~[netty.jar:na] 
    at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:66) ~[netty.jar:na] 
[error] play - Cannot invoke the action, eventually got an error: Thrown(akka.pattern.AskTimeoutException: Timed out) 

: Bir Akka uzak aktör dağıtırken

Bir sorunum var

ActorSystem system = Akka.system(); 

Address addr = new Address("akka", "application"); 
defaultInstance = system.actorOf(new Props(TheActor.class).withDeploy(new Deploy(new RemoteScope(addr))), "theActor"); 

zaman dosyasına koyarak bu yapılandırma:

akka { 
    actor { 
    provider = "akka.remote.RemoteActorRefProvider" 
    } 
    remote { 
    transport = "akka.remote.netty.NettyRemoteTransport" 
    netty { 
     hostname = "127.0.0.1" 
     port = 2552 
    } 
} 
} 

Aynı kurulum play-2.0.1'de düzgün çalışıyor.

Play-2.0.2'de çalışma yapmak için bazı yapılandırma değişikliği var mı?

Teşekkür ederiz.

+0

Benzer sorunu: akka documentation dan, bir otomatik seçtiğinsem kullanmak 0'a noktasını ayarlayabilirsiniz. – schmmd

+0

Oyun 2.0.2 ile başlangıçta başlangıçta 'RemoteServerStarted @ akka: //[email protected]: 9002' oluşturuldu. Eskiden bu, 'uygulama @ 127.0.0.1' idi. Bir aktör oluşturan herhangi bir kod çalıştırıldığında, "Kullanılmakta olan Adres" hatasını alıyorum. – schmmd

+0

Bu hatayı üreten örnek bir uygulama oluşturdum. Https://gist.github.com/3063509 sayfasına bakın. – schmmd

cevap

7

Belki bu deneyin: `concurrent.Akka.future` kullanarak bir söz oluştururken burada

akka { 
    actor { 
    provider = "akka.remote.RemoteActorRefProvider" 
    } 
    remote { 
    transport = "akka.remote.netty.NettyRemoteTransport" 
    netty { 
     hostname = "127.0.0.1" 
     port = 0 
    } 
} 
} 
+0

Uygulamayı bu şekilde dağıtabilirim, ancak bağlantı noktasının başka bir sunucudan uzaktaki aktörü çağırması gerektiğini bilmem gerekiyor. –

+1

Hızlı bir Google aramasından sonra, 'akka.remote.RemoteActorRefProvider.getExternalAddressFor' (https://groups.google.com/forum/?fromgroups#!topic/akka-user/POngjU9UpK8) kullanılarak mümkün görünmektedir. Ardından, bu adresi bir http isteği kullanarak diğer sunucunuzdan almak için bir denetleyici yazabilirsiniz. –

+0

Bu benim için çalıştı. – schmmd

İlgili konular