Le 22/06/16 à 11:50, Simo Chiegang, Boris Arthur a écrit : > I try to restart my server and I get the following unexpected exception as > Warning: > > 2016-06-20 06:18:35,630 | WARN | NioSocketAcceptor-33 > (DefaultExceptionMonitor.java:47) | Unexpected exception. > java.lang.IllegalStateException: A disposed processor cannot be accessed. > at > org.apache.mina.core.service.SimpleIoProcessorPool.getProcessor(SimpleIoProcessorPool.java:361) > at > org.apache.mina.core.service.SimpleIoProcessorPool.add(SimpleIoProcessorPool.java:261) > at > org.apache.mina.core.service.SimpleIoProcessorPool.add(SimpleIoProcessorPool.java:80) > at > org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.processHandles(AbstractPollingIoAcceptor.java:552) > at > org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:483) > at > org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > > I don't know why this appear. I seems like an internal error in MINA, not the > application but may be I'm wrong. > By Restart, I only unbind my acceptor because I wanted to reuse it: > > StopServer() > { > acceptor.unbind(); > } > > > StartServer() > { > If (acceptor != null && !acceptor.isDisposed()) > { > Acceptor.bind(...); > } > } > > It's possible that the MINA dispose the acceptor?
By itself ? No. Here, you are in a state where the internal processors (ie, the class in charge of processing incoming requests) are disposed. You should dispose the acceptor instead of unbinding it when stopping the server. Dispose() will unbind your acceptor anyway. It's critical to do so because a hell lot of cleanup is done during the dispose.