Thread: [JSch-users] Exception when executing second command
Status: Alpha
Brought to you by:
ymnk
From: sf_testing_9_2004 s. <sf_...@ya...> - 2004-11-16 23:39:35
|
Hi I am connecting to Solaris and Linux system and executing two commands using version jsch-0.1.18. The first command succeeds but the second command fails only on Solaris. The second command works on Linux. On debugging the code I found that the function getByte in IO.java throws an IOException, which causes Session to disconnect. This causes the second command to fail execution. The stack trace when IO.getbyte fails is: java.io.IOException: at com.jcraft.jsch.IO.getByte(IO.java:73) at com.jcraft.jsch.Session.read(Session.java:647) at com.jcraft.jsch.Session.run(Session.java:929) at java.lang.Thread.run(Thread.java:534) The sample code which executes the commands is: channel = (ChannelExec) session.openChannel("exec"); channel.setCommand(command); channel.setOutputStream(out); channel.setExtOutputStream(out); channel.connect(); On second call it fails on - channel.connect() call. Any help to resolve the problem would be appreciated. thanks scott --------------------------------- Do you Yahoo!? The all-new My Yahoo! Get yours free! |
From: <ym...@jc...> - 2004-11-17 02:16:36
|
Hi, +-From: sf_testing_9_2004 sf_testing_9_2004 <sf_...@ya...> -- |_Date: Tue, 16 Nov 2004 15:39:27 -0800 (PST) ______________________________ | |I am connecting to Solaris and Linux system and executing two |commands using version jsch-0.1.18. The first command succeeds but |the second command fails only on Solaris. The second command works |on Linux. What kind of sshd is running on Solaris? From SSH2 protocol specification of point of view, sshd may drop the connection after first command execution. If the recent sshd from OpenSSH is running there, such problems should not happened, but I don't have an idea. Thanks, -- ymnk |