• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connect to a remote host using JSch

 
Shikha Upadhyaya
Ranch Hand
Posts: 70
Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 70
Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the problem is solved now?
 
Shikha Upadhyaya
Ranch Hand
Posts: 70
Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:So the problem is solved now?

No. It's not solved.
 
Tim Moores
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, what do you think the error message is trying to tell you?
 
Shikha Upadhyaya
Ranch Hand
Posts: 70
Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 70
Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 70
Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic