Thanks for the answer. That means I cannot reuse the connector after dispose it. I need to get a new NioSocketAcceptor(), am I right?
-----Original Message----- From: Emmanuel Lécharny [mailto:elecha...@gmail.com] Sent: Wednesday, June 22, 2016 12:12 PM To: users@mina.apache.org Subject: Re: problem to restart my server 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. ________________________________ Confidentiality note: The information in this email and any attachment may contain confidential and proprietary information of Heidelberger Druckmaschinen AG and/or its affiliates and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any review, reliance or distribution by others or forwarding without express permission is strictly prohibited and may cause liability. In case you have received this message due to an error in transmission, we kindly ask you to notify the sender immediately and to delete this email and any attachment from your system.