tags:

views:

16

answers:

1

I am using the nice http://www.jcraft.com/jsch/ library - however when I run some commands (seems to happen to a wide variety) I see that jsch returns a getExitStatus of -1, from time to time, even though the script ran fun (when I run it by hand it is consistently a successful 0 exit code). Any ideas?

A: 

I gave up on Jsch - and its incredibly unhelpful API and switched to:

http://www.cleondris.ch/opensource/ssh2/

(Ganymede SSH2). I do a LOT with ssh in the JVM and over months of 24 hour usage ganymede has proven far more reliable. And more pleasant. My main remaining gripe is around being apparently unable to set timeouts for SCP.

Michael Neale