有时获取java.io.IOException:文件传输时从jsch关闭了管道

时间:2019-02-06 02:33:28

标签: sftp jsch

有时我们会遇到java.io.IOException:从FTP传输文件时出现管道关闭错误。 你们对这个问题有什么建议或解决方案吗?

这是堆栈跟踪:

2.15.1.redhat-621216 | JSCH -> Disconnecting from secure.test.com port 22
2019-02-05 14:56:58,755 | WARN  | renewals/request | SftpConsumer                     | 130 - org.apache.camel.camel-core - 2.15.1.redhat-621216 | Error processing file RemoteFile[myTestFile.xml] due to Cannot change directory to: ... Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException - Cannot change directory to: ..]
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot change directory to: ..
    at org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:542)[134:org.apache.camel.camel-ftp:2.15.1.redhat-621216]
    at org.apache.camel.component.file.remote.SftpOperations.changeCurrentDirectory(SftpOperations.java:530)[134:org.apache.camel.camel-ftp:2.15.1.redhat-621216]
    at org.apache.camel.component.file.remote.SftpOperations.retrieveFileToFileInLocalWorkDirectory(SftpOperations.java:741)[134:org.apache.camel.camel-ftp:2.15.1.redhat-621216]
    at org.apache.camel.component.file.remote.SftpOperations.retrieveFile(SftpOperations.java:591)[134:org.apache.camel.camel-ftp:2.15.1.redhat-621216]
    at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:396)[130:org.apache.camel.camel-core:2.15.1.redhat-621216]
    at org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(RemoteFileConsumer.java:137)[134:org.apache.camel.camel-ftp:2.15.1.redhat-621216]
    at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:211)[130:org.apache.camel.camel-core:2.15.1.redhat-621216]
    at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:175)[130:org.apache.camel.camel-core:2.15.1.redhat-621216]
    at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)[130:org.apache.camel.camel-core:2.15.1.redhat-621216]
    at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)[130:org.apache.camel.camel-core:2.15.1.redhat-621216]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_171]
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_171]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_171]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_171]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_171]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_171]
    at java.lang.Thread.run(Thread.java:748)[:1.8.0_171]
Caused by: 4: 
    at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:359)[64:org.apache.servicemix.bundles.jsch:0.1.51.1]
    at org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:540)[134:org.apache.camel.camel-ftp:2.15.1.redhat-621216]
    ... 16 more
Caused by: java.io.IOException: Pipe closed
    at java.io.PipedInputStream.read(PipedInputStream.java:307)[:1.8.0_171]
    at com.jcraft.jsch.Channel$MyPipedInputStream.updateReadSide(Channel.java:362)[64:org.apache.servicemix.bundles.jsch:0.1.51.1]
    at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:337)[64:org.apache.servicemix.bundles.jsch:0.1.51.1]
    ... 17 more
2019-02-05 14:57:58,757 | INFO  | renewals/request | SftpOperations                   | 134 - org.apache.camel.camel-ftp - 

0 个答案:

没有答案