Hello:

I'm using Mina 2.0.7 and I'm getting this error where close a session


java.lang.IllegalStateException: DEAD LOCK: IoFuture.await() was invoked
from an I/O processor thread.  Please use IoFutureListener or configure a
proper thread model alternatively.

      at
org.apache.mina.core.future.DefaultIoFuture.checkDeadLock(DefaultIoFuture.java:240)

      at
org.apache.mina.core.future.DefaultIoFuture.await0(DefaultIoFuture.java:210)

      at
org.apache.mina.core.future.DefaultIoFuture.awaitUninterruptibly(DefaultIoFuture.java:153)


I'm closing session with the next code:

if (this.session != null)
{

CloseFuture future = this.session.close(false);
future.await(10000);
if (!future.isClosed())
throw new Exception("Disconnect timeout after waiting 10 seconds");
}

What could be the right solution?


I don't know why that code fails but the next code doesn't


this.session.write(request);
ReadFuture readFuture = this.session.read();
readFuture.await("10",TimeUnit.SECONDS);

In this case, await() is invoked in  I/O processor thread, but it doesn't
fail



Thanks and regads

Reply via email to