Jsch错误返回代码不一致 [英] Jsch error return codes not consistent

查看:437
本文介绍了Jsch错误返回代码不一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用漂亮的 http://www.jcraft.com/jsch/ 库 - 但是当我运行一些命令时,我看到jsch会不时返回一个-1的getExitStatus,即使脚本运行正常(当我手动运行它时,它始终是一个成功的0退出代码)。有什么想法?

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

(似乎发生在各种各样的命令中)

(seems to happen to a wide variety of commands)

推荐答案

我放弃了Jsch - 以及它令人难以置信的无用API并切换到:

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

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

(Ganymede SSH2)。
我在JVM中使用ssh做了很多工作,经过几个月的24小时使用,ganymede已经证明更加可靠。而且更愉快。我主要的抱怨是显然无法为SCP设置超时。

(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.

这篇关于Jsch错误返回代码不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆