You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Jessica King <jk...@mps-phelon.com> on 2006/03/27 16:54:51 UTC

[NET] Connection Reset Error (but works when debugging)

I have a very strange problem (or at least it seems to me). I have a class
that needs to download a file via FTP. The code works perfectly while I'm
debugging. I don't even step into the methods below, I just step over each
one to watch variables and see what it's doing. However, when I just run the
program, not in debug mode, I get a connection reset error every time;
debugging works without fail and running fails - never working.

 

Any ideas as to what the problem is? I've also tried opening up some desktop
clients, just to make sure the FTP server is ok, and those work fine.

 

 

Here's the code:

ftp = new FTPClient();

ftp.enterLocalPassiveMode() <ftp://ftp.enterlocalpassivemode()/> ; //I've
tried the code with and without this

ftp.connect(server);

ftp.login(username, password);

            testFTPClient(ftp);

            File outputFile = new File(destinationFolder + "\\" +
dbFileName);

            if (outputFile.exists()) {

                outputFile.delete();

            }

            outputFile.createNewFile();

            FileOutputStream fos = new FileOutputStream(outputFile);

            ftp.retrieveFile(dbFileName, fos);

            fos.close();

            ftp.disconnect() <ftp://ftp.disconnect()/> ;

 

Any help or suggestions would be greatly appreciated.

Jessica King
Client/Server Programmer

 

Manufacturing Performance Services, LLC
--A phelon Company--
895 University Parkway
Aiken, SC 29802



 


**************************************************************************************************
The contents of this email and any attachments are confidential.
They are intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or  the 
sender immediately and do not disclose the contents to anyone or make copies.

** eSafe scanned this email for viruses, vandals and malicious content. **
**************************************************************************************************