I am using apache commons library for connecting to FTP server. Please find below the code -
Now my problem is - I do not get any exception but still ftp.getReplyString() returns '530 Login incorrect.'. Can you please help me with this.
We are using port 22 on the ftp server. Can that be the reason for this error?
I modified my code and included port as well while connecting, as folllows - ftp.connect(addr, 22);
but now I am getting an exception - Server Reply: SSH-1.99-OpenSSH_3.6.1p2 at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:284) at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:335) at org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:550) at org.apache.commons.net.SocketClient.connect(SocketClient.java:142) at com.novus.file.ftp.JakartaWrapperTest.main(JakartaWrapperTest.java:26)
Is it to do something with Active FTP or Passive FTP?
JCE - Please Use Code Tags [ August 19, 2008: Message edited by: Joe Ess ]
This reply leads me to believe that you are connecting to an SSH service, not FTP. Port 22 is usually bound to an SSH server. Port 21 is typical for an FTP server. Have you tried connecting with an FTP client? Are you supposed to be using SFTP (FTP over SSH)?