Discuss (FTP) and (SFTP, FTPS and SCP), our Java file transfer clients.
no avatar
User

avirat

Posts

3

Joined

Sat Sep 10, 2011 4:15 am

com.enterprisedt.net.ftp.FTPException: 500 Illegal PORT comm

by avirat » Sat Sep 10, 2011 4:22 am

I am using edtftpj 2.2.2 APis and is running into following exception. I am able to connect to the host and list directory using "ftp" program. I have replaced the ipAddress of my host with <myHost>

DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.370 : 220 ProFTPD 1.3.1 Server (ProFTPD) [<myHost>]
DEBUG [FileTransferClient] 9 Sep 2011 18:13:19.371 : Client connected
DEBUG [FileTransferClient] 9 Sep 2011 18:13:19.371 : Logging in
DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.371 : ---> USER test
DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.387 : 331 Password required for test
DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.388 : ---> PASS ********
DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.427 : 230 User test logged in
DEBUG [FileTransferClient] 9 Sep 2011 18:13:19.427 : Logged in
DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.427 : ---> TYPE I
DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.447 : 200 Type set to I
18:13:19,448 INFO [ConnectorTest] Connection successful to host <myHost>
DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.463 : ---> SYST
DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.478 : 215 UNIX Type: L8
DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.487 : ---> PWD
DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.502 : 257 "/" is the current directory
DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.503 : ListenOnAllInterfaces=true
DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.504 : ---> PORT 10,172,154,82,234,128
DEBUG [FTPControlSocket] 9 Sep 2011 18:13:19.519 : 500 Illegal PORT command
INFO [FTPControlSocket] 9 Sep 2011 18:13:19.519 : Expected reply codes = [200,250]
18:13:19,521 ERROR [FtpConnector] Failed to list current directory
com.enterprisedt.net.ftp.FTPException: 500 Illegal PORT command
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:1223)
at com.enterprisedt.net.ftp.FTPControlSocket.setDataPort(FTPControlSocket.java:815)
at com.enterprisedt.net.ftp.FTPControlSocket.sendPORTCommand(FTPControlSocket.java:669)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocketActive(FTPControlSocket.java:616)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocket(FTPControlSocket.java:583)
at com.enterprisedt.net.ftp.FTPClient.setupDataSocket(FTPClient.java:2596)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:3586)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:3678)
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:3507)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:644)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:630)
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: com.enterprisedt.net.ftp.FTPException: 500 Illegal PORT

by support2 » Sat Sep 10, 2011 6:49 am

use ftp.getAdvancedFTPSettings().setActiveIPAddress("<host ip>")
no avatar
User

avirat

Posts

3

Joined

Sat Sep 10, 2011 4:15 am

by avirat » Sat Sep 10, 2011 6:54 am

from the logs ------ PORT 10,172,154,82,234,128

10.172.154.82 is the correct IP address from where my java program is connecting to <myHost>. Do you still think I should use ftp.getAdvancedFTPSettings().setActiveIPAddress("10.172.154.82") ?
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

by support2 » Sat Sep 10, 2011 7:00 am

Ok, that won't help then. I thought it might have been a local address.

Try using Windows ftp.exe to see if that works. Otherwise you might have to switch to passive mode - I can't see anything wrong with the PORT command you sent.
no avatar
User

avirat

Posts

3

Joined

Sat Sep 10, 2011 4:15 am

by avirat » Sat Sep 10, 2011 7:16 am

from my windows development box. Everything works fine. ftp.exe and the java program are successful.

But from a linux box(Amazon Linux AMI release 2011.02.1.1) the java program does not work but if I use the ftp program it works fine.
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

by support2 » Sat Sep 10, 2011 10:41 pm

Post the debug output from the ftp program on Linux. There must be something different about the PORT command used.
no avatar
User

ping17909

Posts

3

Joined

Thu Sep 27, 2012 2:52 pm

by ping17909 » Thu Sep 27, 2012 3:10 pm


Who is online

Users browsing this forum: No registered users and 85 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron