【发布时间】:2012-12-27 21:29:31
【问题描述】:
我将 camel 从 2.8.0 升级到 2.10.3 版本,我的 sftp 组件开始出现故障。 Afaik,sftp 组件默认使用 stepwise 并且在升级之前更改目录没有问题。
下面是我在 camel/jsch 上看到的日志条目
20130113 15:28:54,509 信息 [骆驼 (camel-1) 线程 #0 - file://../test_outbound/] RemoteFileProducer[193]:已连接并 登录到: 端点[sftp://sftp-user@localhost/incoming?disconnect=true&privateKeyFile=xyz.ppk&privateKeyFilePassphrase=**] 20130113 15:28:54,528 WARN [骆驼 (camel-1) 线程 #0 - file://../test_outbound/] RemoteFileProducer[71]: 写入文件失败 与:无法将目录更改为:home 20130113 15:28:54,528 DEBUG [骆驼(camel-1)线程#0 - file://../test_outbound/] RemoteFileProducer[86]:断开连接: 端点[sftp://sftp-user@localhost/incoming?disconnect=true&privateKeyFile=xyz.ppk&privateKeyFilePassphrase=**] 20130113 15:28:54,529 信息 [骆驼 (camel-1) 线程 #0 - file://../test_outbound/] SftpOperations$JSchLogger[259]: JSCH -> 从 localhost 端口断开连接 22 20130113 15:28:54,529 INFO [连接线程 localhost 会话] SftpOperations$JSchLogger[259]: JSCH -> 捕获异常,由于套接字关闭而离开主循环
不知道为什么会这样?任何想法表示赞赏,谢谢。
cd 适用于 v2.8.0
20130114 18:42:52,956 信息 [骆驼 (camel-1) 线程 #0 - sftp://user@host/outgoing] RemoteFileConsumer[133]:已连接并 登录到:sftp://user@host:22 20130114 18:42:52,956 TRACE [骆驼 (camel-1) 线程 #0 - sftp://user@host/outgoing] SftpOperations[339]: getCurrentDirectory() 20130114 18:42:52,959 TRACE [骆驼 (camel-1) 线程 #0 - sftp://user@host/outgoing] SftpConsumer[68]: doPollDirectory from absolutePath:传出,dirName:null 20130114 18:42:52,959 TRACE [骆驼 (camel-1) 线程 #0 - sftp://user@host/outgoing] SftpOperations[348]: changeCurrentDirectory(outgoing) 20130114 18:42:52,959 TRACE [骆驼 (camel-1) 线程 #0 - sftp://user@host/outgoing] SftpOperations[389]: 更改目录:传出 20130114 18:42:52,966 TRACE [骆驼 (camel-1) 线程 #0 - sftp://user@host/outgoing] SftpConsumer[81]: 投票目录:传出 20130114 18:42:52,966 TRACE [骆驼 (camel-1) 线程 #0 - sftp://user@host/outgoing] SftpOperations[415]: listFiles(.) 20130114 18:42:52,982 TRACE [骆驼 (camel-1) 线程 #0 - sftp://user@host/outgoing] SftpConsumer[94]:在目录中找到 2: 传出 20130114 18:42:52,982 TRACE [骆驼 (camel-1) 线程 #0 - sftp://user@host/outgoing] SftpOperations[348]: changeCurrentDirectory(/home/sftp-user) 20130114 18:42:52,982 TRACE [骆驼 (camel-1) 线程 #0 - sftp://user@host/outgoing] SftpOperations[389]:更改目录:/ 20130114 18:42:52,988 TRACE [骆驼 (camel-1) 线程 #0 - sftp://user@host/outgoing] SftpOperations [389]:更改目录:home 20130114 18:42:52,994 TRACE [骆驼 (camel-1) 线程 #0 - sftp://user@host/outgoing] SftpOperations [389]:更改目录:sftp-user 20130114 18:42:53,000 调试 [骆驼 (camel-1) 线程 #0 - sftp://user@host/outgoing] GenericFileConsumer[84]:耗时 0.044 秒 投票:传出
并在 2.10.3 中失败
20130114 19:15:53,530 信息 [骆驼 (camel-1) 线程 #0 - file://../test_outbound/] RemoteFileProducer[193]:已连接并 登录到: 端点[sftp://user@host/incoming?disconnect=true&knownHostsFile=known_hosts&privateKeyFile=sftp-user.ppk&privateKeyFilePassphrase=**&separator=Auto] 20130114 19:15:53,530 TRACE [骆驼 (camel-1) 线程 #0 - file://../test_outbound/] SftpOperations[305]: buildDirectory(incoming,false) 20130114 19:15:53,530 TRACE [骆驼 (camel-1) 线程 #0 - file://../test_outbound/] SftpOperations[372]: getCurrentDirectory() 20130114 19:15:53,670 TRACE [骆驼 (camel-1) 线程 #0 - file://../test_outbound/] SftpOperations[381]: changeCurrentDirectory(/home/sftp-user) 20130114 19:15:53,670 TRACE [骆驼(camel-1)线程#0 - file://../test_outbound/] SftpOperations[372]:getCurrentDirectory() 20130114 19:15:53,670 TRACE [骆驼(camel-1)线程#0 - file://../test_outbound/] SftpOperations[430]:更改目录:\ 20130114 19:15:53,749 TRACE [骆驼(camel-1)线程#0 - file://../test_outbound/] SftpOperations[430]:更改目录:home 20130114 19:15:53,796 WARN [Camel (camel-1) thread #0 - file://../test_outbound/] RemoteFileProducer [71]:写入文件失败:无法更改 目录到:home
看起来分隔符不好,但我尝试了所有 3 个选项(Windows、Unix、Auto)... 都没有工作。
【问题讨论】:
-
恢复到 v2.8.0,sftp 再次开始工作,但我想使用仅适用于 2.10.x 的 CamelSpringJUnit4ClassRunner
标签: apache-camel jsch