my dog learned polymorphism*
The moose likes Sockets and Internet Protocols and the fly likes Error : Connection refused Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Error : Connection refused" Watch "Error : Connection refused" New topic

Error : Connection refused

Gokulakannan Vasu

Joined: Jan 11, 2011
Posts: 14
Hi All,

I tried connecting a remote Unix server using Java code.I gave my remote IP address and my system IP address for the connection purpose.I am getting an exception like Connection refused

Herewith i furnished my code as well.Kindly guide me to connect to the remote host.

Rob Spoor

Joined: Oct 27, 2005
Posts: 19655

You do know we have other forums here as well, right? I quote myself from 10 days ago in your previous thread:
Rob Spoor wrote:I've read your post but I can't find any user interface related code in there, not even in the imports. Please CarefullyChooseOneForum.

This time I'm moving this to our Sockets and Internet Protocols forum.

The reason for this exception is clear from the message: you don't have access to connect. Either the SSH connection to fails or the tunneling fails. I can't tell which because you don't show the exception stack trace. Please TellTheDetails.

Rob Spoor wrote:I suggest you try alternatives like JSch.

Well, at least you've followed that piece of advice.

How To Ask Questions How To Answer Questions
gowrishankar balakrishnan

Joined: May 19, 2011
Posts: 1
The reason may be because of your unix server is stopped by someone, when you are trying to access at the same time
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Error : Connection refused
Similar Threads
Invoking unix shell commands from java.
jsch, trying to open tunnel and connect sftp
jcraft.jsch problem
java.rmi.ConnectException: Connection refused to host
How to connect to Linux using Java code?