aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes java.net.ConnectException: Connection refused: connect -- FTP issue (using org.apache.commons.net.ft Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "java.net.ConnectException: Connection refused: connect -- FTP issue (using org.apache.commons.net.ft" Watch "java.net.ConnectException: Connection refused: connect -- FTP issue (using org.apache.commons.net.ft" New topic
Author

java.net.ConnectException: Connection refused: connect -- FTP issue (using org.apache.commons.net.ft

kumar kb
Greenhorn

Joined: Dec 05, 2011
Posts: 2
hi,

i was trying to connect unix server using the commons-net-3.0.1.jar API.
Below are the lines of code to connect to thse server

-------------------------------------------------------------
ftpClient = new org.apache.commons.net.ftp.FTPClient();
ftpClient.connect(server);
ftpClient.login(username, password);
-------------------------------------------------------------

I am getting the below error
-----------------------------------------------------------
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:366)
at java.net.Socket.connect(Socket.java:519)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:168)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:189)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:278)
-----------------------------------------------------------
Anybody can you please suggest/help.

regards
kumar


Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19784
    
  20

You are not allowed to connect. Either there is no FTP server running, or a firewall is blocking your connections.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.net.ConnectException: Connection refused: connect -- FTP issue (using org.apache.commons.net.ft