aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Connect to a remote host using JSch Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Connect to a remote host using JSch" Watch "Connect to a remote host using JSch" New topic
Author

Connect to a remote host using JSch

Shikha Upadhyaya
Ranch Hand

Joined: Aug 17, 2011
Posts: 70

Hi,
I have a form which takes user@hostname and password as input. I have written the following code:

It is throwing an exception. May I know what has to be corrected?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Are you going to tell us what exception that was, and in which line of code it happened, or are we supposed to guess?
Shikha Upadhyaya
Ranch Hand

Joined: Aug 17, 2011
Posts: 70

Tim Moores wrote:Are you going to tell us what exception that was, and in which line of code it happened, or are we supposed to guess?

Oh sorry. Here's the exception:
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
So the problem is solved now?
Shikha Upadhyaya
Ranch Hand

Joined: Aug 17, 2011
Posts: 70

Tim Moores wrote:So the problem is solved now?

No. It's not solved.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Well, what do you think the error message is trying to tell you?
Shikha Upadhyaya
Ranch Hand

Joined: Aug 17, 2011
Posts: 70

Tim Moores wrote:Well, what do you think the error message is trying to tell you?

I guess it is not able to locate the host. Is it right?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Correct. Is that host name resolvable on the machine where you're running the code? It sure is not on mine.
Shikha Upadhyaya
Ranch Hand

Joined: Aug 17, 2011
Posts: 70

Tim Moores wrote:Correct. Is that host name resolvable on the machine where you're running the code? It sure is not on mine.

Yes, the hostname is resolvable. When I tried out this out it is working fine. But when I tried to write something on my own, I is not working out.
Shikha Upadhyaya
Ranch Hand

Joined: Aug 17, 2011
Posts: 70

Hi, it is working now. I followed this link. But I am not able to figure out what exactly has been done so that my code is working fine now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connect to a remote host using JSch
 
Similar Threads
mouseClicked event for the "Cancel button"
Resizing JPanel and its inner components when JFrame is maximised
Switching between two forms
Prevent Duplicate value from jlist to jlist by way of a jbutton
How to open a file using Java