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

frankpt

Posts

2

Joined

Mon Sep 08, 2008 12:32 am

java.net.ConnectException: Connection refused: connect

by frankpt » Mon Sep 08, 2008 12:47 am

Hi, I use the client (runing on Windows XP) to connect to my FTP server (on VMware, Fedora 5, vsftpd) and got the following exceptions:


java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
at java.net.Socket.connect(Socket.java:507)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)FTP Connection Error: IOException Connection refused: connect

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.enterprisedt.net.ftp.internal.SocketUtils.createSocket(SocketUtils.java:94)
at com.enterprisedt.net.ftp.FTPControlSocket.<init>(FTPControlSocket.java:310)
at com.enterprisedt.net.ftp.FTPClient.connect(FTPClient.java:862)
at com.enterprisedt.net.ftp.FileTransferClient.connect(FileTransferClient.java:367)
at envgui.GuiFrame.jMenuItem1_actionPerformed(GuiFrame.java:67)



I can use the ftp command in DOS to connect with the FTP server:
C:\Documents and Settings\frank>ftp 192.168.1.111
Connected to 192.168.1.111.
220 (vsFTPd 2.0.4)
User (192.168.1.111:(none)): root
331 Please specify the password.
Password:
230 Login successful.
ftp>

My Java code is:
FileTransferClient ftp = new FileTransferClient();
try{
ftp.setRemoteHost(si.ftpip); //si.ftpip = 192.168.1.111
ftp.setRemotePort(si.ftpport); // = 23
ftp.setUserName(si.ftpusr); // = root
ftp.setPassword(si.ftppwd); // = 11122233
// ftp.setTimeout(60000);
// ftp.getAdvancedSettings().setAutoLogin(false);
ftp.connect();
// ftp.manualLogin();
}catch(FTPException fe){
System.out.println("FTP Connection Error: FTPException " + fe.getMessage());
}catch(IOException ie){
System.out.println("FTP Connection Error: IOException " + ie.getMessage());
ie.printStackTrace();
}

Even though I uncomment those lines above, the problems are still the same. (I have debuged the program, si.* is correct)

Is anybody can help me with that? Thanks!
no avatar
User

frankpt

Posts

2

Joined

Mon Sep 08, 2008 12:32 am

by frankpt » Mon Sep 08, 2008 2:27 am

I have solved the problem, it is my application's problem. Many thanks!
no avatar
User

logaritme

Posts

4

Joined

Tue Jul 28, 2009 6:26 pm

Conenction refused error

by logaritme » Tue Jul 28, 2009 6:40 pm

Hi
I have the same problem. Do you remember how you solve it?

Thanks
no avatar
User

support2

Posts

3869

Joined

Tue May 18, 2004 8:30 am

Re: Conenction refused error

by support2 » Tue Jul 28, 2009 8:12 pm

Try ftp.exe from the DOS command line.

If that works, make sure your port number is 21 and the hostname is correct. And use active mode (which is what ftp.exe uses).
no avatar
User

logaritme

Posts

4

Joined

Tue Jul 28, 2009 6:26 pm

Re: Conenction refused error

by logaritme » Tue Jul 28, 2009 9:45 pm

Hi
I have tried with active and passive mode, and not works.
I don't know what happens. Probably is because a proxy server, but I don't know how solve it.
In msdos ftp works well.
no avatar
User

support2

Posts

3869

Joined

Tue May 18, 2004 8:30 am

Re: Conenction refused error

by support2 » Wed Jul 29, 2009 7:11 am

If MSDOS ftp works, it should also work. Post the log file and we'll take a look.
no avatar
User

logaritme

Posts

4

Joined

Tue Jul 28, 2009 6:26 pm

Re: Conenction refused error

by logaritme » Wed Jul 29, 2009 8:16 pm

This is the program that I execute

try
{
FileTransferClient ftp = new FileTransferClient();
ftp.setTimeout(60000);
ftp.setRemoteHost("10.81.114.10"); // FTP server IP
ftp.setUserName("ftpdc2");
ftp.setPassword("testPassw");
ftp.setRemotePort(21);
ftp.connect();
ftp.changeDirectory("/users");
ftp.changeDirectory("ftpdc2");
System.out.println("connect mode=" + ftp.getAdvancedFTPSettings().getConnectMode());
FTPFile[] list2 = ftp.directoryList();
ftp.disconnect(true);
}
catch (Exception e)
{
e.printStackTrace();
}

This is the log result. As you see, when it excute the command PORT, the address received is 10.84.144.8 (the FTP address where I try to connect is 10.84.144.10). This is because a Lisa Server firewall.

C:\dc2error>java TestConn
DEBUG [FTPClient] 29 jul 2009 10:40:28.182 : Class: com.enterprisedt.net.ftp.FTP
Client
Location: file:/C:/dc2error/edtftpj.jar
Version: 2.0.4
Build timestamp: 13-Feb-2009 15:09:20 EST
Java version: 1.6.0
CLASSPATH: .;./ojdbc14.jar;.;./ojdbc14.jar;.;./edtftpj.jar;./ojdbc14.jar;./junit
.jar;.;./ojdbc14.jar;
OS name: Windows XP
OS arch: x86
OS version: 5.1

DEBUG [FileTransferClient] 29 jul 2009 10:40:28.197 : Configured client
DEBUG [FTPClient] 29 jul 2009 10:40:28.197 : Connecting to /10.81.114.10:21
DEBUG [SocketUtils] 29 jul 2009 10:40:28.197 : Invoking connect with timeout=60000
DEBUG [SocketUtils] 29 jul 2009 10:40:28.244 : Connected successfully
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.275 : 220 odin FTP server (Revision 3.0 Version wuftpd-2.6.1 Wed Dec 19 08:45:38 GMT 2007) ready.
DEBUG [FileTransferClient] 29 jul 2009 10:40:28.275 : Client connected
DEBUG [FileTransferClient] 29 jul 2009 10:40:28.275 : Logging in
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.275 : ---> USER ftpdc2
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.307 : 331 Password required for ftpdc2.
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.307 : ---> PASS ********
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.353 : 230 User ftpdc2 logged in.
DEBUG [FileTransferClient] 29 jul 2009 10:40:28.353 : Logged in
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.353 : ---> TYPE I
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.369 : 200 Type set to I.
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.369 : ---> CWD /users
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.400 : 250 CWD command successful.
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.400 : ---> CWD ftpdc2
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.432 : 250 CWD command successful.
connect mode=Active
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.447 : ---> SYST
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.478 : 215 UNIX Type: L8
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.478 : ---> PWD
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.510 : 257 "/users/ftpdc2" is current directory.
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.510 : ListenOnAllInterfaces=true
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.525 : ---> PORT 10,84,144,8,5,105
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.541 : 200 PORT command successful.

DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.541 : ---> LIST
DEBUG [FTPControlSocket] 29 jul 2009 10:40:28.603 : 425 Can't build data connection: Connection refused.
DEBUG [FTPActiveDataSocket] 29 jul 2009 10:40:28.603 : Calling accept()
DEBUG [FTPClient] 29 jul 2009 10:41:28.605 : Validate transfer on error after exception : Accept timed out
java.net.SocketTimeoutException: Accept timed out
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.acceptConnection(FTPActiveDataSocket.java:129)
at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.getInputStream(FTPActiveDataSocket.java:153)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:3351)
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:3282)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:568)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:554)
at TestConn.test(TestConn.java:30)
at TestConn.main(TestConn.java:42)


java.net.SocketTimeoutException: Accept timed out
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.acceptConnection(FTPActiveDataSocket.java:129)
at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.getInputStream(FTPActiveDataSocket.java:153)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:3351)
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:3282)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:568)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:554)
at TestConn.test(TestConn.java:30)
at TestConn.main(TestConn.java:42)
ERROR [FTPControlSocket] 29 jul 2009 10:41:29.105 : Read failed ('' read so far)

WARN [FTPClient] 29 jul 2009 10:41:29.105 : Validate transfer on error failed : Read timed out
com.enterprisedt.net.ftp.ControlChannelIOException: Read timed out
at com.enterprisedt.net.ftp.FTPControlSocket.readLine(FTPControlSocket.java:962)
at com.enterprisedt.net.ftp.FTPControlSocket.readReply(FTPControlSocket.java:997)
at com.enterprisedt.net.ftp.FTPClient.validateTransfer(FTPClient.java:2347)
at com.enterprisedt.net.ftp.FTPClient.validateTransferOnError(FTPClient.java:2379)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:3362)
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:3282)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:568)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:554)
at TestConn.test(TestConn.java:30)
at TestConn.main(TestConn.java:42)


com.enterprisedt.net.ftp.ControlChannelIOException: Read timed out
at com.enterprisedt.net.ftp.FTPControlSocket.readLine(FTPControlSocket.java:962)
at com.enterprisedt.net.ftp.FTPControlSocket.readReply(FTPControlSocket.java:997)
at com.enterprisedt.net.ftp.FTPClient.validateTransfer(FTPClient.java:2347)
at com.enterprisedt.net.ftp.FTPClient.validateTransferOnError(FTPClient.java:2379)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:3362)
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:3282)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:568)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:554)
at TestConn.test(TestConn.java:30)
at TestConn.main(TestConn.java:42)
DEBUG [FTPActiveDataSocket] 29 jul 2009 10:41:29.121 : close() succeeded
java.net.SocketTimeoutException: Accept timed out
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.acceptConnection(FTPActiveDataSocket.java:129)
at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.getInputStream(FTPActiveDataSocket.java:153)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:3351)
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:3282)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:568)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:554)
at TestConn.test(TestConn.java:30)
at TestConn.main(TestConn.java:42)

C:\dc2error>



If I remove the firewall configuration in the pc, the program works well. The address connecting is 10.81.114.10 (FTP server).


C:\dc2error>java TestConn
DEBUG [FTPClient] 29 jul 2009 10:47:09.539 : Class: com.enterprisedt.net.ftp.FTPClient
Location: file:/C:/dc2error/edtftpj.jar
Version: 2.0.4
Build timestamp: 13-Feb-2009 15:09:20 EST
Java version: 1.6.0
CLASSPATH: .;./ojdbc14.jar;.;./edtftpj.jar;./ojdbc14.jar;./junit.jar;
OS name: Windows XP
OS arch: x86
OS version: 5.1

DEBUG [FileTransferClient] 29 jul 2009 10:47:09.555 : Configured client
DEBUG [FTPClient] 29 jul 2009 10:47:09.555 : Connecting to /10.81.114.10:21
DEBUG [SocketUtils] 29 jul 2009 10:47:09.555 : Invoking connect with timeout=60000
DEBUG [SocketUtils] 29 jul 2009 10:47:09.601 : Connected successfully
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.617 : 220 odin FTP server (Revision 3.0 Version wuftpd-2.6.1 Wed Dec 19 08:45:38 GMT 2007) ready.
DEBUG [FileTransferClient] 29 jul 2009 10:47:09.617 : Client connected
DEBUG [FileTransferClient] 29 jul 2009 10:47:09.617 : Logging in
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.617 : ---> USER ftpdc2
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.648 : 331 Password required for ftpdc2.
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.648 : ---> PASS ********
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.695 : 230 User ftpdc2 logged in.
DEBUG [FileTransferClient] 29 jul 2009 10:47:09.695 : Logged in
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.695 : ---> TYPE I
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.726 : 200 Type set to I.
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.726 : ---> CWD /users
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.742 : 250 CWD command successful.
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.742 : ---> CWD ftpdc2
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.773 : 250 CWD command successful.
connect mode=Active
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.773 : ---> SYST
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.805 : 215 UNIX Type: L8
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.805 : ---> PWD
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.836 : 257 "/users/ftpdc2" is current directory.
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.836 : ListenOnAllInterfaces=true
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.836 : ---> PORT 10,84,145,64,5,126

DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.867 : 200 PORT command successful.

DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.867 : ---> LIST
DEBUG [FTPControlSocket] 29 jul 2009 10:47:09.914 : 150 Opening BINARY mode data connection for /usr/bin/ls.
DEBUG [FTPActiveDataSocket] 29 jul 2009 10:47:09.914 : Calling accept()
DEBUG [FTPActiveDataSocket] 29 jul 2009 10:47:09.914 : accept() succeeded
ALL [FTPClient] 29 jul 2009 10:47:09.914 : total 128
ALL [FTPClient] 29 jul 2009 10:47:09.914 : drwxr-xr-x 5 ftpdc2 alm0
4096 Jan 27 2009 DC2
ALL [FTPClient] 29 jul 2009 10:47:09.914 : drwxrwxrwx 184 ftpdc2 alm0
12288 Jul 20 10:34 helps
ALL [FTPClient] 29 jul 2009 10:47:09.930 : drwxr-xr-x 2 ftpdc2 alm0
11264 Aug 17 2008 imags
ALL [FTPClient] 29 jul 2009 10:47:09.930 : drwxr-xr-x 2 ftpdc2 alm0
2048 Jul 20 10:34 libs
ALL [FTPClient] 29 jul 2009 10:47:09.930 : drwxr-xr-x 4 ftpdc2 alm0
96 Aug 4 2008 old
ALL [FTPClient] 29 jul 2009 10:47:09.930 : drwxr-xr-x 2 ftpdc2 alm0
1024 Dec 16 2008 props
ALL [FTPClient] 29 jul 2009 10:47:09.930 : drwxr-xr-x 3 ftpdc2 alm0
4096 Jun 3 13:54 reports
ALL [FTPClient] 29 jul 2009 10:47:09.930 : -rw-r--r-- 1 ftpdc2 alm0
30479 May 19 10:31 startup.exe
DEBUG [FTPActiveDataSocket] 29 jul 2009 10:47:09.930 : closeChild() succeeded
DEBUG [FTPActiveDataSocket] 29 jul 2009 10:47:09.930 : close() succeeded
DEBUG [FTPControlSocket] 29 jul 2009 10:47:10.070 : 226 Transfer complete.
DEBUG [FTPFileFactory] 29 jul 2009 10:47:10.070 : Confirmed format UNIX
WARN [FTPClient] 29 jul 2009 10:47:10.070 : cancelTransfer() called

C:\dc2error>


Thanks very much
no avatar
User

support2

Posts

3869

Joined

Tue May 18, 2004 8:30 am

Re: Conenction refused error

by support2 » Wed Jul 29, 2009 10:34 pm

One difference is the IP the server is being asked to connect back to:

PORT 10,84,145,64 (success)

and

PORT 10,84,144,8 (failure)

Is the second IP address valid for the server? You can set the IP address in the advanced settings (setActiveIPAddress())
no avatar
User

logaritme

Posts

4

Joined

Tue Jul 28, 2009 6:26 pm

Re: Conenction refused error

by logaritme » Thu Jul 30, 2009 7:07 pm

I have run de program with setActiveIPAddress and not works.
This is the structure of the net:

----------
| PC | 10.84.145.64
----------
|
|
-------------
| FIREWALL | 10.84.144.8 (NAT)
-------------
|
|
----------------
| FTP SERVER | 10.80.114.10
----------------

Now I have run this code with the firewall on:

try
{
FileTransferClient ftp = new FileTransferClient();
ftp.setTimeout(60000);
ftp.setRemoteHost("10.81.114.10"); // FTP server IP
ftp.setUserName("ftpdc2");
ftp.setPassword("testPassw");
ftp.setRemotePort(21);
ftp.getAdvancedFTPSettings().setActiveIPAddress("10.84.145.64");
ftp.connect();
ftp.changeDirectory("/users");
ftp.changeDirectory("ftpdc2");
System.out.println("connect mode=" + ftp.getAdvancedFTPSettings().getConnectMode());
FTPFile[] list2 = ftp.directoryList();
ftp.disconnect(true);
}
catch (Exception e)
{
e.printStackTrace();
}


and log result is this:


C:\dc2error>java TestConn
DEBUG [FTPClient] 30 jul 2009 10:49:23.855 : Class: com.enterprisedt.net.ftp.FTPClient
Location: file:/C:/dc2error/edtftpj.jar
Version: 2.0.4
Build timestamp: 13-Feb-2009 15:09:20 EST
Java version: 1.6.0
CLASSPATH: .;./ojdbc14.jar;.;./ojdbc14.jar;.;./ojdbc14.jar;.;./ojdbc14.jar;.;./o
jdbc14.jar;.;./edtftpj.jar;./ojdbc14.jar;./junit.jar;
OS name: Windows XP
OS arch: x86
OS version: 5.1

DEBUG [FileTransferClient] 30 jul 2009 10:49:23.871 : Configured client
DEBUG [FTPClient] 30 jul 2009 10:49:23.871 : Connecting to /10.81.114.10:21
DEBUG [SocketUtils] 30 jul 2009 10:49:23.886 : Invoking connect with timeout=60000
DEBUG [SocketUtils] 30 jul 2009 10:49:23.933 : Connected successfully
DEBUG [FTPControlSocket] 30 jul 2009 10:49:23.949 : 220 odin FTP server (Revision 3.0 Version wuftpd-2.6.1 Wed Dec 19 08:45:38 GMT 2007) ready.
DEBUG [FileTransferClient] 30 jul 2009 10:49:23.964 : Client connected
DEBUG [FileTransferClient] 30 jul 2009 10:49:23.964 : Logging in
DEBUG [FTPControlSocket] 30 jul 2009 10:49:23.964 : ---> USER ftpdc2
DEBUG [FTPControlSocket] 30 jul 2009 10:49:23.996 : 331 Password required for ftpdc2.
DEBUG [FTPControlSocket] 30 jul 2009 10:49:23.996 : ---> PASS ********
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.043 : 230 User ftpdc2 logged in.
DEBUG [FileTransferClient] 30 jul 2009 10:49:24.043 : Logged in
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.043 : ---> TYPE I
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.058 : 200 Type set to I.
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.074 : ---> CWD /users
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.089 : 250 CWD command successful.
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.089 : ---> CWD ftpdc2
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.121 : 250 CWD command successful.
connect mode=Active
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.136 : ---> SYST
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.152 : 215 UNIX Type: L8
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.168 : ---> PWD
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.199 : 257 "/users/ftpdc2" is current directory.
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.199 : ListenOnAllInterfaces=true
INFO [FTPControlSocket] 30 jul 2009 10:49:24.199 : Forcing use of fixed IP for PORT command
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.199 : ---> PORT 10,84,145,64,5,81
DEBUG [FTPControlSocket] 30 jul 2009 10:49:24.230 : 500 Illegal PORT Command
INFO [FTPControlSocket] 30 jul 2009 10:49:24.230 : Expected reply codes = [200,250]
com.enterprisedt.net.ftp.FTPException: 500 Illegal PORT Command
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:1127)
at com.enterprisedt.net.ftp.FTPControlSocket.setDataPort(FTPControlSocket.java:756)
at com.enterprisedt.net.ftp.FTPControlSocket.sendPORTCommand(FTPControlSocket.java:632)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocketActive(FTPControlSocket.java:576)
at com.enterprisedt.net.ftp.FTPControlSocket.createDataSocket(FTPControlSocket.java:544)
at com.enterprisedt.net.ftp.FTPClient.setupDataSocket(FTPClient.java:2452)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:3324)
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:3282)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:568)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:554)
at TestConn.test(TestConn.java:34)
at TestConn.main(TestConn.java:47)

C:\dc2error>


If I put the firewall off and execute the same code, the program works well.
Do you see something wrong?

Thanks
no avatar
User

support2

Posts

3869

Joined

Tue May 18, 2004 8:30 am

Re: Conenction refused error

by support2 » Mon Aug 03, 2009 10:46 pm

I think you probably need to talk to your firewall administrator ...

Who is online

Users browsing this forum: No registered users and 0 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign