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: 2407
posted Dec 05, 2011 04:14:02
0
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: 2407
posted Dec 05, 2011 23:24:03
0
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: 2407
posted Dec 06, 2011 02:33:00
0
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: 2407
posted Dec 06, 2011 02:38:29
0
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.
subject: Connect to a remote host using JSch