commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard, Steven \(US - Tulsa\)" <sthow...@deloitte.com>
Subject FTPClient problem with remote-remote transfers
Date Fri, 27 Aug 2004 14:08:03 GMT
I am working on an FTP file management system for my company and I am
using the FTPClient class. The two servers I am testing this portion on
are IIS - one on Windows 2003 and one on Windows NT 4.0. I am using
commons-net 1.2.2. The entire method is very long, but the portion where
an error continues to be encountered is as follows:

 

        try

        {

            if (mode == DtoolConst.FTP_MODE_PASSIVE)

            {

                System.out.println("mode 1");

                if (!ftp1.enterRemotePassiveMode())

                {

                    throw new IOException("Could not set " + serverName
+ " into passive mode\nThe server error returned was:"

                        + ftp1.getReplyString() + "\n" +
getLogIdInfo());

                }

                if (!
ftp2.enterRemoteActiveMode(InetAddress.getByName(ftp1.getPassiveHost()),
ftp1.getPassivePort()))

                {

                    throw new IOException("Could not set " + serverName2
+ " into active mode\nThe server error returned was:"

                        + ftp2.getReplyString() + "\n" +
getLogIdInfo());

 

                }

                System.out.println("mode set with both servers");

            }

            else

            {

                if (!ftp2.enterRemotePassiveMode())

                {

                    throw new IOException("Could not set " + serverName2
+ " into passive mode\nThe server error returned was:"

                        + ftp2.getReplyString() + "\n" +
getLogIdInfo());

                }

                if (!
ftp1.enterRemoteActiveMode(InetAddress.getByName(ftp2.getPassiveHost()),
ftp2.getPassivePort()))

                {

                    throw new IOException("Could not set " + serverName
+ " into active mode\nThe server error returned was:"

                        + ftp1.getReplyString() + "\n" +
getLogIdInfo());

 

                }

                System.out.println("Both servers set");

 

            }

        }

        catch (IOException e)

        {

            System.err.println(e.getMessage());

            logMsg.append(e.getMessage() + "\n");

            errored = true;

            stepIsSuccessful.addElement(new Boolean(false));

            auditStep(false);

            try

            {

                ftp1.disconnect();

                ftp2.disconnect();

            }

            catch (Exception f){}

            return;

        }

 

 

The error I always get is as follows. As you can see, (and I have
verified many times) the error occurs when trying to set one server into
active mode:

 

Could not set core_nt_11 into active mode

The server error returned was: 500 Invalid PORT command.

 

 

No matter which server I set as the active and which I set as the
passive, I always get the error about the Invalid PORT command. I do not
have a Solaris or Linux machine that can see these windows boxes, so I
am not able to test with them.

 

Can anyone spot a problem with what I am doing? Is there a known problem
with IIS not working with the remote-remote transfers?

 

Any help is appreciated.

 

Steve H.




This message (including any attachments) contains confidential information intended for a
specific individual and purpose, and is protected by law.  If you are not the intended recipient,
you should delete this message.  Any disclosure, copying, or distribution of this message,
or the taking of any action based on it, is strictly prohibited.

Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message