Mule SFTP端点无法打开本地文件

时间:2014-06-11 08:28:55

标签: java mule sftp

我有一个Mule流,它通过ftp服务器的通用入站端点读取文件,对数据进行一些修改,并通过通用出站端点将文件写入sftp服务器。昨天它处理了60个文件。在57上没有错误,但在三个上面出现了以下痕迹。欢迎任何建议。

Error writing data over SFTP service, error was: Failed to open local file
4: Failed to open local file
    at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2297)
    at com.jcraft.jsch.ChannelSftp._put(ChannelSftp.java:484)
    at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:438)
    at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:405)
    at org.mule.transport.sftp.SftpClient.storeFile(SftpClient.java:385)
    at org.mule.transport.sftp.SftpMessageDispatcher.doDispatch(SftpMessageDispatcher.java:176)
    at org.mule.transport.AbstractMessageDispatcher.process(AbstractMessageDispatcher.java:100)
    at org.mule.transport.AbstractConnector$DispatcherMessageProcessor.process(AbstractConnector.java:2553)
    at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:105)
    at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:55)
    at org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:111)
    at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:158)
    at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:43)
    at org.mule.work.WorkerContext.run(WorkerContext.java:310)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
[ERROR] DispatchingLogger [Services].xmlSftpConnector.dispatcher.29 2014-06-09 15:55:07 Unexpected exception attempting to write file, message was: Failed to open local file
java.io.IOException: Failed to open local file
    at org.mule.transport.sftp.SftpClient.storeFile(SftpClient.java:390)
    at org.mule.transport.sftp.SftpMessageDispatcher.doDispatch(SftpMessageDispatcher.java:176)
    at org.mule.transport.AbstractMessageDispatcher.process(AbstractMessageDispatcher.java:100)
    at org.mule.transport.AbstractConnector$DispatcherMessageProcessor.process(AbstractConnector.java:2553)
    at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:105)
    at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:55)
    at org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:111)
    at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:158)
    at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:43)
    at org.mule.work.WorkerContext.run(WorkerContext.java:310)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
[WARN] SftpUtil [Services].xmlSftpConnector.dispatcher.29 2014-06-09 15:55:07 Class java.io.ByteArrayInputStream did not implement the 'ErrorOccurred' decorator, errorOccured=true could not be set.
[ERROR] DispatchingLogger [Services].xmlSftpConnector.dispatcher.29 2014-06-09 15:55:07 
********************************************************************************
Message               : Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=sftp://user:<password>@server.com/folder/test/upload, connector=SftpConnector
{
  name=xmlSftpConnector
  lifecycle=start
  this=cfc9fac
  numberOfConcurrentTransactedReceivers=4
  createMultipleTransactedReceivers=true
  connected=true
  supportedProtocols=[sftp]
  serviceOverrides=<none>
}
,  name='endpoint.sftp.server.com.22.folder.test.upload', mep=ONE_WAY, properties={outputPattern=#[function:datestamp:dd-MM-yy]_#[function:systime].xml}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: String
Code                  : MULE_ERROR-42999
--------------------------------------------------------------------------------
Exception stack is:
1. Failed to open local file (java.io.IOException)
  org.mule.transport.sftp.SftpClient:390 (null)
2. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=sftp://user:<password>@server.com/folder/test/upload, connector=SftpConnector
{
  name=xmlSftpConnector
  lifecycle=start
  this=cfc9fac
  numberOfConcurrentTransactedReceivers=4
  createMultipleTransactedReceivers=true
  connected=true
  supportedProtocols=[sftp]
  serviceOverrides=<none>
}
,  name='endpoint.sftp.server.com.22.folder.test.upload', mep=ONE_WAY, properties={outputPattern=#[function:datestamp:dd-MM-yy]_#[function:systime].xml}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: String (org.mule.api.transport.DispatchException)
  org.mule.transport.AbstractMessageDispatcher:109 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.io.IOException: Failed to open local file
    at org.mule.transport.sftp.SftpClient.storeFile(SftpClient.java:390)
    at org.mule.transport.sftp.SftpMessageDispatcher.doDispatch(SftpMessageDispatcher.java:176)
    at org.mule.transport.AbstractMessageDispatcher.process(AbstractMessageDispatcher.java:100)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

1 个答案:

答案 0 :(得分:1)

看起来有三个原因之一:

  1. 您要写入的文件夹的权限。
  2. 文件路径(或名称)上的空格。
  3. 文件路径中的斜杠错误。
  4. 根据评论

    编辑

    您可以尝试配置maxThreadsActive以限制一次激活的线程数。

    <dispatcher-threading-profile maxThreadsActive="5" maxThreadsIdle="5"/>