【问题标题】:Object org.mule.transport.sftp.SftpInputStream not of correct type errorObject org.mule.transport.sftp.SftpInputStream not of correct type error
【发布时间】:2016-09-29 10:12:36
【问题描述】:

我已经在 Mule 批处理流程中设置了一个 sftp 端点,以从我在笔记本电脑上本地设置的 CrushFTP 服务器中提取一个 test.csv 文件。

当我部署 Mule 项目时,它已成功部署,但随后我看到此错误消息,因为它反复尝试提取 csv 文件:

*******************************************************************************************************
*            - - + APPLICATION + - -            *       - - + DOMAIN + - -       * - - + STATUS + - - *
*******************************************************************************************************
* sftpproj                                      * default                        * DEPLOYED           *
*******************************************************************************************************

INFO  2016-09-29 10:43:34,241 [[sftpproj].SFTP.receiver.01] com.mulesoft.module.batch.engine.DefaultBatchEngine: Created instance 30388390-8629-11e6-a2c5-1e6f20524153 for batch job sftpprojBatch
INFO  2016-09-29 10:43:34,243 [[sftpproj].SFTP.receiver.01] com.mulesoft.module.batch.engine.DefaultBatchEngine: Starting input phase
INFO  2016-09-29 10:43:34,245 [[sftpproj].SFTP.receiver.01] com.mulesoft.module.batch.engine.DefaultBatchEngine: Input phase completed
ERROR 2016-09-29 10:43:34,281 [[sftpproj].SFTP.receiver.01] org.mule.exception.DefaultMessagingExceptionStrategy: 
********************************************************************************
Message               : Object "org.mule.transport.sftp.SftpInputStream" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException)
Type                  : com.mulesoft.module.batch.exception.BatchException
Code                  : MULE_ERROR--2
********************************************************************************
Exception stack is:
1. Object "org.mule.transport.sftp.SftpInputStream" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException)
  org.mule.util.collection.EventToMessageSequenceSplittingStrategy:64 (null)
2. Object "org.mule.transport.sftp.SftpInputStream" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException) (com.mulesoft.module.batch.exception.BatchException)
  com.mulesoft.module.batch.engine.DefaultBatchEngine:378 (null)
********************************************************************************
Root Exception stack trace:
java.lang.IllegalArgumentException: Object "org.mule.transport.sftp.SftpInputStream" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}"
    at org.mule.util.collection.EventToMessageSequenceSplittingStrategy.split(EventToMessageSequenceSplittingStrategy.java:64)
    at org.mule.util.collection.EventToMessageSequenceSplittingStrategy.split(EventToMessageSequenceSplittingStrategy.java:25)
    at com.mulesoft.module.batch.engine.queue.BatchQueueLoader.splitAndLoad(BatchQueueLoader.java:63)
    at com.mulesoft.module.batch.engine.DefaultBatchEngine.load(DefaultBatchEngine.java:361)
    at com.mulesoft.module.batch.DefaultBatchJob.execute(DefaultBatchJob.java:305)
    at com.mulesoft.module.batch.DefaultBatchJob$1.process(DefaultBatchJob.java:229)
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
    at org.mule.transport.AbstractMessageReceiver.routeEvent(AbstractMessageReceiver.java:511)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:226)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:208)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:200)
    at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:187)
    at org.mule.transport.sftp.SftpMessageReceiver$1.process(SftpMessageReceiver.java:203)
    at org.mule.transport.sftp.SftpMessageReceiver$1.process(SftpMessageReceiver.java:179)
    at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)
    at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35)
    at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22)
    at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)
    at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)
    at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67)
    at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)
    at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)
    at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)
    at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)
    at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)
    at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)
    at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)
    at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:110)
    at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30)
    at org.mule.transport.sftp.SftpMessageReceiver.routeFile(SftpMessageReceiver.java:178)
    at org.mule.transport.sftp.SftpMessageReceiver.poll(SftpMessageReceiver.java:121)
    at org.mule.transport.AbstractPollingMessageReceiver.performPoll(AbstractPollingMessageReceiver.java:216)
    at org.mule.transport.PollingReceiverWorker.poll(PollingReceiverWorker.java:80)
    at org.mule.transport.PollingReceiverWorker.run(PollingReceiverWorker.java:49)
    at org.mule.transport.TrackingWorkManager$TrackeableWork.run(TrackingWorkManager.java:267)
    at org.mule.work.WorkerContext.run(WorkerContext.java:286)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

********************************************************************************

看起来数据类型不正确,但不确定如何更改它,因为我无法在 sftp 端点和 sftp 服务器之间放置转换连接器。我已在 sftp 端点的高级选项卡中将 MIME 类型设置为 application/csv,但错误消息仍然存在。

有谁知道我该如何解决这个问题?

XML 代码:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ftp="http://www.mulesoft.org/schema/mule/ee/ftp" xmlns:sftp="http://www.mulesoft.org/schema/mule/sftp" xmlns:batch="http://www.mulesoft.org/schema/mule/batch" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/sftp http://www.mulesoft.org/schema/mule/sftp/current/mule-sftp.xsd
http://www.mulesoft.org/schema/mule/batch http://www.mulesoft.org/schema/mule/batch/current/mule-batch.xsd
http://www.mulesoft.org/schema/mule/ee/ftp http://www.mulesoft.org/schema/mule/ee/ftp/current/mule-ftp-ee.xsd">
    <sftp:connector name="SFTP" validateConnections="true" doc:name="SFTP"/>
    <batch:job name="orderexperienceBatch">
        <batch:input>
            <sftp:inbound-endpoint connector-ref="SFTP" host="localhost" port="2222" path="//" user="${ftp.user}" password="${ftp.password}" responseTimeout="10000" mimeType="application/csv" doc:name="SFTP"/>
        </batch:input>
        <batch:process-records>
            <batch:step name="Batch_Step">
                <logger level="INFO" doc:name="Logger"/>
            </batch:step>
        </batch:process-records>
        <batch:on-complete>
            <logger level="INFO" doc:name="Logger"/>
        </batch:on-complete>
    </batch:job>
</mule>

CSV 文件:

1,test

【问题讨论】:

    标签: csv mule sftp anypoint-studio


    【解决方案1】:

    这不是您的 CSV 或配置的问题。实际上batch:input 应该生成可迭代的数据。把下面的DWL,它会正常工作。

    %dw 1.0
    %output application/java
    ---
    payload
    

    希望对你有帮助

    【讨论】:

    • 谢谢。看起来它已经解决了该错误,但现在收到此错误:ERROR 2016-09-29 12:13:46,804 [[orderexperience].SFTP.receiver.01] org.mule.transport.sftp.SftpMessageReceiver: Error in poll java .io.IOException: 3: %DELE-bad%
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-27
    相关资源
    最近更新 更多