why the remote server always throw this exception?

7 views
Skip to first unread message

Caesar You

unread,
Nov 18, 2009, 2:38:10 AM11/18/09
to Akka User List
below are my src code:

object AppServer {
def main(args: Array[String]) {
RemoteServer.start("192.168.1.100", 4567)
}
}

case object Done
object AppClient {
def main(args: Array[String]) {
val client = new Client
client.start
client ! "hello, world!"
while(true) {
Thread sleep 100
}
}
}

class Client extends Actor {
makeRemote("192.168.1.100", 4567)
lifeCycle = Some(LifeCycle(Permanent, 100))

def receive: PartialFunction[Any, Unit] = {
case Done => exit
case msg => println("receive message " + msg)
}
}

i run AppServer on one JVM, and AppClient on another JVM.
and the server always has an error:
ERR [20091118-15:28:03.737] nio: Unexpected exception from remote
downstream: ja
va.lang.IllegalStateException: await*() in I/O thread causes a dead
lock or sudd
en performance drop. Use addListener() instead or call await*() from a
different
thread.
java.lang.IllegalStateException: await*() in I/O thread causes a dead
lock or su
dden performance drop. Use addListener() instead or call await*() from
a differe
nt thread.
at org.jboss.netty.channel.DefaultChannelFuture.checkDeadLock
(DefaultCha
nnelFuture.java:268)
at
org.jboss.netty.channel.DefaultChannelFuture.awaitUninterruptibly(Def
aultChannelFuture.java:197)
at se.scalablesolutions.akka.nio.RemoteClient.connect
(RemoteClient.scala
:80)
at se.scalablesolutions.akka.nio.RemoteClient$.clientFor
(RemoteClient.sc
ala:44)
at se.scalablesolutions.akka.actor.Actor$$anonfun
$postMessageToMailbox$1
.apply(Actor.scala:503)
at se.scalablesolutions.akka.util.Helpers
$ReadWriteLock.withReadLock(Hel
pers.scala:61)
at se.scalablesolutions.akka.actor.Actor
$class.postMessageToMailbox(Acto
r.scala:491)
at se.scalablesolutions.akka.actor.Actor$class.$bang
(Actor.scala:273)
at com.ding.Client.$bang(App.scala:23)
at
se.scalablesolutions.akka.nio.RemoteServerHandler.dispatchToActor(Rem
oteServer.scala:120)
at
se.scalablesolutions.akka.nio.RemoteServerHandler.handleRemoteRequest
(RemoteServer.scala:111)
at
se.scalablesolutions.akka.nio.RemoteServerHandler.messageReceived(Rem
oteServer.scala:100)
at
se.scalablesolutions.akka.nio.RemoteServerHandler.handleUpstream(Remo
teServer.scala:94)
at org.jboss.netty.channel.Channels.fireMessageReceived
(Channels.java:38
5)
at
org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(O
neToOneDecoder.java:82)
at org.jboss.netty.channel.Channels.fireMessageReceived
(Channels.java:38
5)
at
org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessage
Received(FrameDecoder.java:324)
at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode
(FrameDeco
der.java:306)
at
org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(Fram
eDecoder.java:223)
at org.jboss.netty.channel.Channels.fireMessageReceived
(Channels.java:34
2)
at org.jboss.netty.channel.Channels.fireMessageReceived
(Channels.java:32
9)
at org.jboss.netty.channel.socket.nio.NioWorker.read
(NioWorker.java:330)

at
org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioW
orker.java:282)
at org.jboss.netty.channel.socket.nio.NioWorker.run
(NioWorker.java:203)
at org.jboss.netty.util.internal.IoWorkerRunnable.run
(IoWorkerRunnable.j
ava:53)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(Unknown Source
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)
at java.lang.Thread.run(Unknown Source)

Why is that?
thanks.

Jonas Bonér

unread,
Nov 18, 2009, 4:07:18 AM11/18/09
to akka...@googlegroups.com
I think I have fixed in in master now.
Try to do a pull and retry your sample.
Let me know if it works.

Also you will need to change:
lifeCycle = Some(LifeCycle(Permanent, 100)
To:
lifeCycle = Some(LifeCycle(Permanent)

2009/11/18 Caesar You <uca...@gmail.com>:
> --
>
> You received this message because you are subscribed to the Google Groups "Akka User List" group.
> To post to this group, send email to akka...@googlegroups.com.
> To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/akka-user?hl=.
>
>
>



--
Jonas Bonér

twitter: @jboner
blog: http://jonasboner.com
work: http://scalablesolutions.se
code: http://github.com/jboner
code: http://akkasource.org
also: http://letitcrash.com

Caesar You

unread,
Nov 18, 2009, 7:01:26 AM11/18/09
to Akka User List
it works!
thx master jBonér!

On Nov 18, 5:07 pm, Jonas Bonér <jbo...@gmail.com> wrote:
> I think I have fixed in in master now.
> Try to do a pull and retry your sample.
> Let me know if it works.
>
> Also you will need to change:
>    lifeCycle = Some(LifeCycle(Permanent, 100)
> To:
>    lifeCycle = Some(LifeCycle(Permanent)
>
> 2009/11/18 Caesar You <ucae...@gmail.com>:
> > For more options, visit this group athttp://groups.google.com/group/akka-user?hl=.

Jonas Bonér

unread,
Nov 18, 2009, 7:08:58 AM11/18/09
to akka...@googlegroups.com
Glad to hear that.

----
Reply all
Reply to author
Forward
0 new messages