Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
6.2k views
in Java FTP by
Hi,

I am using the proxy to connect to the server. I use the initSOCKS and initSOCKSAuthentication for proxy and then ftpClient.login. The server authenticates the user but then I get the following error. But If I comment out the proxy authentication I can download the files by ftp.
Please can someone suggest where i am going wrong?


DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:28.598 : ---> USER sg52044
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:28.677 : 331 Password required for sg52044.
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:28.677 : ---> PASS ********
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:29.5 : 230 User sg52044 logged in.
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:29.5 : ---> TYPE I
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:29.5 : 200 Type set to I.
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:29.5 : ---> PASV
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:29.5 : 227 Entering Passive Mode (150,110,142,56,99,176)
Exception occured in FTP : java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
at java.net.PlainSocketImpl.connectToSocksServer(PlainSocketImpl.java:335)
at java.net.PlainSocketImpl.doSOCKSConnect(PlainSocketImpl.java:228)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:135)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
at java.net.Socket.<init>(Socket.java:268)
at java.net.Socket.<init>(Socket.java:95)
at com.enterprisedt.net.ftp.FTPControlSocket.newPassiveDataSocket(FTPControlSocket.java:461)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocketPASV(FTPControlSocket.java:445)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocket(FTPControlSocket.java:293)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:1600)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:1566)
at cbm.xfer.downloadFile(Download.java:58)
at cbm.xfer.main(Download.java:105)
Process terminated with exit code 1

6 Answers

0 votes
by (161k points)
If you can download without using proxy auth, why put it in?

Hi,

I am using the proxy to connect to the server. I use the initSOCKS and initSOCKSAuthentication for proxy and then ftpClient.login. The server authenticates the user but then I get the following error. But If I comment out the proxy authentication I can download the files by ftp.
Please can someone suggest where i am going wrong?
0 votes
by
Hi,

First of all, thanks much for replying back. Actually I am doing some test functionality now...but in the final version there will be a proxy between me and the server...so I am doing the simulation.

What I dont get is that the login works fine...but then when I do to download it fails....Can you suggest what can be the possiblities??? I think there is a problem between the Proxy and server connection....

Thanks
0 votes
by (161k points)
Have a read of

http://www.enterprisedt.com/general/doc ... erview.pdf

that explains control sockets and data sockets

Hi,

First of all, thanks much for replying back. Actually I am doing some test functionality now...but in the final version there will be a proxy between me and the server...so I am doing the simulation.

What I dont get is that the login works fine...but then when I do to download it fails....Can you suggest what can be the possiblities??? I think there is a problem between the Proxy and server connection....

Thanks
0 votes
by
So I got that I can get the control connection but not the data connection.....so how do I go forward???
What checks should I do???????????

Shruti
0 votes
by (161k points)
You could try PASV mode instead of active (if you are using active).

Try doing the same thing using a command-line client

So I got that I can get the control connection but not the data connection.....so how do I go forward???
What checks should I do???????????

Shruti
0 votes
by
Hi,

I am using the proxy to connect to the server. I use the initSOCKS and initSOCKSAuthentication for proxy and then ftpClient.login. The server authenticates the user but then I get the following error. But If I comment out the proxy authentication I can download the files by ftp.
Please can someone suggest where i am going wrong?


DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:28.598 : ---> USER sg52044
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:28.677 : 331 Password required for sg52044.
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:28.677 : ---> PASS ********
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:29.5 : 230 User sg52044 logged in.
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:29.5 : ---> TYPE I
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:29.5 : 200 Type set to I.
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:29.5 : ---> PASV
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 28 Jun 2004 12:10:29.5 : 227 Entering Passive Mode (150,110,142,56,99,176)
Exception occured in FTP : java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
at java.net.PlainSocketImpl.connectToSocksServer(PlainSocketImpl.java:335)
at java.net.PlainSocketImpl.doSOCKSConnect(PlainSocketImpl.java:228)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:135)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
at java.net.Socket.<init>(Socket.java:268)
at java.net.Socket.<init>(Socket.java:95)
at com.enterprisedt.net.ftp.FTPControlSocket.newPassiveDataSocket(FTPControlSocket.java:461)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocketPASV(FTPControlSocket.java:445)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocket(FTPControlSocket.java:293)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:1600)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:1566)
at cbm.xfer.downloadFile(Download.java:58)
at cbm.xfer.main(Download.java:105)
Process terminated with exit code 1
:cry:

Categories

...