naimishk / sshxcute

Automatically exported from code.google.com/p/sshxcute
0 stars 0 forks source link

the getInstance method on SSHExec will provide the same object irrespective of the ConnBean #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Make a connection to a remote server A and then disconnet it
2. Make a new connection to a different server B
3. The connection will still be made to the same old server A

What is the expected output? What do you see instead?
The connection is always being made to the same server and even if i set the 
existitng connection to null, i am not able to set the SSHExec to call a 
different server. 

What version of the product are you using? On what operating system?
1.0

Please provide any additional information below.
I want to make connection to multiple servers to provide information on a 
portal about application current status. Once one connection is made and 
information fetched, i want to make a new call to a different server and fetch 
some other information. But this is not happening.

Original issue reported on code.google.com by abhi.agg...@gmail.com on 12 Oct 2012 at 9:02

GoogleCodeExporter commented 8 years ago
I"m also facing the same issue.

Issue:
1. Make a connection to a remote server A and then disconnet it
2. Make a new connection to a different server B
3. The connection will still be made to the same old server A

 Even after disconnection the first SSH connection, I"m not able to connect to the second sever (here its server B). Please let me how to destroy the connection object at the end of the program or let me know any alternative to resolve the issue.

Original comment by bonyt...@gmail.com on 25 Nov 2012 at 7:19

GoogleCodeExporter commented 8 years ago
I faced the same issue. However I found a workaround as below:
1. Create an instance of ConnBean with hostname, username and password.
2. Pass the reference of ConnBean to getInstance() method.
3. Hold the reference of ConnBean in some variable and change the hostname, 
username and password by calling setter methods.
4. If you connect again, the new hostname, username and password will be used.

Original comment by ameertam...@gmail.com on 18 Dec 2012 at 5:40

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
solution
step1:- add package to eclipse

step 2:- create your own SSHExec.java file in your project and copy the code to 
your file

step3:- make the SSHExec constructor public(remote private) 
           use SSHExec(ConnBean) instead to .getInstance()

step4:- don't import core.SSHExec to your project

Original comment by prajwal....@gmail.com on 18 Apr 2013 at 9:19

GoogleCodeExporter commented 8 years ago
here is the patch for resolving this issue

Original comment by araza...@gmail.com on 15 May 2013 at 2:27

Attachments:

GoogleCodeExporter commented 8 years ago
Prajwal Great job

Original comment by prudhvi...@gmail.com on 1 Jul 2013 at 3:55

GoogleCodeExporter commented 8 years ago
I used the patched jar it is working for executing multiple commands. Thanks 
for sharing the patched jar

Original comment by pmuthuv...@gmail.com on 14 Apr 2014 at 5:28

GoogleCodeExporter commented 8 years ago
patch file works but what are the differences on this patch?

Original comment by suayipoz...@gmail.com on 23 Apr 2014 at 9:44

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Path is worked.  Thank you very much araza...@gmail.com

Original comment by makub...@gmail.com on 25 Sep 2014 at 3:14