2012-03-19 202 views
0

我有一臺運行Apache FTPServer的服務器。 FTP服務器運行良好,直到最近從客戶端上傳的一些上傳文件開始失敗,並附帶此錯誤。我增加了MaxIdleTimeout,但仍然遇到此錯誤。任何人有任何想法到什麼實際上產生這個錯誤?java.io.IOException:現有連接被遠程主機強行關閉

16 Mar 22:19:30,792 WARN [pool-3-thread-10] [LoggingFilter->log()]:122 - EXCEPTION : 
java.io.IOException: An existing connection was forcibly closed by the remote host 
    at sun.nio.ch.SocketDispatcher.read0(Native Method) 
    at sun.nio.ch.SocketDispatcher.read(Unknown Source) 
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source) 
    at sun.nio.ch.IOUtil.read(Unknown Source) 
    at sun.nio.ch.SocketChannelImpl.read(Unknown Source) 
    at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:202) 
    at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:42) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:620) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969) 
    at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) 
    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) 
16 Mar 22:19:30,792 WARN [pool-3-thread-10] [LoggingFilter->log()]:122 - EXCEPTION : 
java.io.IOException: An existing connection was forcibly closed by the remote host 
    at sun.nio.ch.SocketDispatcher.read0(Native Method) 
    at sun.nio.ch.SocketDispatcher.read(Unknown Source) 
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source) 
    at sun.nio.ch.IOUtil.read(Unknown Source) 
    at sun.nio.ch.SocketChannelImpl.read(Unknown Source) 
    at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:202) 
    at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:42) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:620) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969) 
    at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) 
    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) 
16 Mar 22:19:30,792 ERROR[pool-3-thread-10] [DefaultFtpHandler->exceptionCaught()]:156 - Exception caught, closing session 
java.io.IOException: An existing connection was forcibly closed by the remote host 
    at sun.nio.ch.SocketDispatcher.read0(Native Method) 
    at sun.nio.ch.SocketDispatcher.read(Unknown Source) 
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source) 
    at sun.nio.ch.IOUtil.read(Unknown Source) 
    at sun.nio.ch.SocketChannelImpl.read(Unknown Source) 
    at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:202) 
    at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:42) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:620) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969) 
    at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) 
    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) 
16 Mar 22:19:30,792 ERROR[pool-3-thread-10] [DefaultFtpHandler->exceptionCaught()]:156 - Exception caught, closing session 
java.io.IOException: An existing connection was forcibly closed by the remote host 
    at sun.nio.ch.SocketDispatcher.read0(Native Method) 
    at sun.nio.ch.SocketDispatcher.read(Unknown Source) 
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source) 
    at sun.nio.ch.IOUtil.read(Unknown Source) 
    at sun.nio.ch.SocketChannelImpl.read(Unknown Source) 
    at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:202) 
    at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:42) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:620) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61) 
    at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969) 
    at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) 
    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) 

回答

1

它看起來像錯誤說,服務器關閉了你的連接。通常情況下,這是由於您不活躍的結果。如果你不跟服務器通話,它會關閉你的連接。如果連接閒置,您需要發送NOOP命令流給它,讓它知道你還在那裏。

相關問題