Problem with first connect in j2ssh

"Teemu Lehto" <[email protected]>
Newsgroups gmane.comp.java.sshtools.user
Message-ID <[email protected]>
Hi!

We have tested j2ssh version 0.2.6 on our environment. None of the applications has UI, so basicly client reads data from database. Applications in this environment are:

client-app
Application that sends messages to server app and and receives answers and handles them.
server-app
Application that connects remote-server-app using j2ssh software. Receives messages from client and sends them to remote server, waits for reply and sends answers back to client.
remote-server-app
Receives messages, handles them and sends back answers

Multiple clients can connect server-app and it has to handle all connections to remote server. We have a problem with server-app and remote-server.

In server-app we build up connection like this (remember there can be multiple connections at the same time):

if (sshClient == null) {
sshClient = new SshClient();

SshConnectionProperties props = new SshConnectionProperties();
props.setHost("111.111.111.111");
props.setPort("22");

// Connect to the host
sshClient.connect(props, new IgnoreHostKeyVerification());

PasswordAuthenticationClient pw = new PasswordAuthenticationClient();
pw.setUsername("user");
pw.setPassword("passwd");

int result = sshClient.authenticate(pw);
}
SessionChannelClient s = sshClient.openSessionChannel();

if (s.startShell()) {
log.debug("SSHShell started OK");
}
else {
throw new Exception("SSH Session shell could not be started");
}
// Get and set the sessions streams
setOutputStream(s.getOutputStream());
setInputputStream(s.getInputStream());

Now in remote server we have some problems starting shell. Every time when sshclient connects server 1. shell fails to start process it needs. We can close sessions and start new ones in one connection and this problem occurs only at 1st time.

Even when sshClient is disconnected failed prosess won't disappear??? Very strange!!!

I know that we don't call method requesPseudoTerminal(). Could this cause our problem?

Has anyone else had same kind of problems???

Does j2ssh use some kind of tunneling in building up ssh connection???

Please email me as soon as possible...

Best regards

-Teemu-

----------
Add photos to your e-mail with MSN 8. Get 2 months FREE*.

-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.