B
Barry
Hi,
Can somebody help me out on the following problem:
I am using the Jakarta Commons Net package to perform FTP operations.
I created a test program that connected to a remote AIX machine to
upload and download a file from my local machine (Windows XP). This
all works fine. However, now I uploaded the code to USS and the code
seems to freeze when executing the connect method of the FTPClient
class. Below is a code fragment.
ftpClient = new FTPClient();
log.info("1");
// Attach a listener to the client, so that the commands are
logged
ftpClient.addProtocolCommandListener(new
FTPCommandListener(logger));
try {
// Connect to the remote server
log.info("2a");
ftpClient.connect(settings.server, 21);
log.info(ftpClient.getReplyString());
// check reply code.
if (!FTPReply.isPositiveCompletion(ftpClient.getReplyCode())) {
ftpClient.disconnect();
log.info("Connection refused.");
return;
}
log.info("2b");
// Logon usgin the credentials
ftpClient.login(settings.userName,settings.password);
// Most remote servers are behing a firewall, so enable passive
mode
log.info("3");
if (settings.passiveMode) ftpClient.enterLocalPassiveMode();
// Check if the connection is established...
replyCommunication = ftpClient.getReplyCode();
log.info("4");
if (!FTPReply.isPositiveCompletion(replyCommunication))
{
ftpClient.disconnect();
throw new Exception("Connection failed");
}
The last debugging info printed is "2a".
I've tried different scenario's (host name/ip address, active/passive
mode, with and without port number), but so far the results are the
same. By the way: manually connecting to the remote machine using FTP
commands from the command prompt does work, so that's not the problem.
Can anyone help me out?
Best regards,
Barry
Can somebody help me out on the following problem:
I am using the Jakarta Commons Net package to perform FTP operations.
I created a test program that connected to a remote AIX machine to
upload and download a file from my local machine (Windows XP). This
all works fine. However, now I uploaded the code to USS and the code
seems to freeze when executing the connect method of the FTPClient
class. Below is a code fragment.
ftpClient = new FTPClient();
log.info("1");
// Attach a listener to the client, so that the commands are
logged
ftpClient.addProtocolCommandListener(new
FTPCommandListener(logger));
try {
// Connect to the remote server
log.info("2a");
ftpClient.connect(settings.server, 21);
log.info(ftpClient.getReplyString());
// check reply code.
if (!FTPReply.isPositiveCompletion(ftpClient.getReplyCode())) {
ftpClient.disconnect();
log.info("Connection refused.");
return;
}
log.info("2b");
// Logon usgin the credentials
ftpClient.login(settings.userName,settings.password);
// Most remote servers are behing a firewall, so enable passive
mode
log.info("3");
if (settings.passiveMode) ftpClient.enterLocalPassiveMode();
// Check if the connection is established...
replyCommunication = ftpClient.getReplyCode();
log.info("4");
if (!FTPReply.isPositiveCompletion(replyCommunication))
{
ftpClient.disconnect();
throw new Exception("Connection failed");
}
The last debugging info printed is "2a".
I've tried different scenario's (host name/ip address, active/passive
mode, with and without port number), but so far the results are the
same. By the way: manually connecting to the remote machine using FTP
commands from the command prompt does work, so that's not the problem.
Can anyone help me out?
Best regards,
Barry