• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
kumar kb
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20493
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are not allowed to connect. Either there is no FTP server running, or a firewall is blocking your connections.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic