I'm thinking out loud here, but is it possible that the client is getting disconnected in the middle of the upload and then resuming the upload again? This may cause the uploadFinished to be called more than once. It would help if you have a client side log as well.
Regards, Sai Pullabhotla On Thu, Dec 31, 2009 at 12:55 PM, Vinicius Carvalho <vinicius.carva...@sambatech.com.br> wrote: > > Hello there! We have an FTP server running for the last 4 months. It's quite > stable, but a few weeks ago we noticed a strange behavior. When sending > large files (we experienced this with files larger than 100mb). The client > side gets an acknowledge, but on the server side there's an error: > > [31/12/09 11:12:45:045 BRST] ERROR > org.apache.ftpserver.impl.DefaultFtpHandler: Exception caught, closing > session > java.io.IOException: Connection reset by peer > at sun.nio.ch.FileDispatcher.read0(Native Method) > at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21) > at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233) > at sun.nio.ch.IOUtil.read(IOUtil.java:206) > at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:236) > at > org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:179) > at > org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:41) > at > org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:585) > at > org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:563) > at > org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:552) > at > org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:56) > at > org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:891) > at > org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > > And because of this, the onuploadend is called twice. We can reproduce this > with several clients, with large files, on all of them, the error happens. > The problem is that our FTPLet depends on the onuploadend to process the > file sent. > > Is there a reason for this? Is there any other info needed to help me on > this? > > Regards > > -- > The intuitive mind is a sacred gift and the > rational mind is a faithful servant. We have > created a society that honors the servant and > has forgotten the gift.