#csv #mule #sftp #anypoint-studio
#csv #mule #sftp #anypoint-studio
Вопрос:
У меня есть простой поток sftp mule, который извлекает файл из локального экземпляра CrushFTP. Похоже, что это работает успешно, и я вижу содержимое файла в полезной нагрузке и вижу, что файл удален, но я продолжаю получать сообщение об ошибке ниже. Как я могу остановить эту ошибку?
*******************************************************************************************************
* - - APPLICATION - - * - - DOMAIN - - * - - STATUS - - *
*******************************************************************************************************
* sftpproj * default * DEPLOYED *
*******************************************************************************************************
INFO 2016-09-29 19:21:43,617 [[sftpproj].sftpprojFlow.stage1.02] com.mulesoft.weave.mule.utils.MuleWeaveFactory$: MimeType was not resolved '*/*' delegating to Java.
INFO 2016-09-29 19:21:44,272 [[sftpproj].sftpprojFlow.stage1.03] com.mulesoft.weave.mule.utils.MuleWeaveFactory$: MimeType was not resolved '*/*' delegating to Java.
ERROR 2016-09-29 19:21:44,998 [[sftpproj].SFTP.receiver.01] org.mule.transport.sftp.SftpMessageReceiver: Error in poll
java.io.IOException: /input/test.csv is not a valid file path (//input/test.csv)
at org.mule.transport.sftp.SftpClient.getSize(SftpClient.java:474) ~[mule-transport-sftp-3.7.3.jar:3.7.3]
at org.mule.transport.sftp.SftpClient.retrieveFile(SftpClient.java:353) ~[mule-transport-sftp-3.7.3.jar:3.7.3]
at org.mule.transport.sftp.SftpReceiverRequesterUtil.retrieveFile(SftpReceiverRequesterUtil.java:187) ~[mule-transport-sftp-3.7.3.jar:3.7.3]
at org.mule.transport.sftp.SftpMessageReceiver$1.process(SftpMessageReceiver.java:188) ~[mule-transport-sftp-3.7.3.jar:3.7.3]
at org.mule.transport.sftp.SftpMessageReceiver$1.process(SftpMessageReceiver.java:179) ~[mule-transport-sftp-3.7.3.jar:3.7.3]
at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:110) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.transport.sftp.SftpMessageReceiver.routeFile(SftpMessageReceiver.java:178) ~[mule-transport-sftp-3.7.3.jar:3.7.3]
at org.mule.transport.sftp.SftpMessageReceiver.poll(SftpMessageReceiver.java:121) ~[mule-transport-sftp-3.7.3.jar:3.7.3]
at org.mule.transport.AbstractPollingMessageReceiver.performPoll(AbstractPollingMessageReceiver.java:216) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.transport.PollingReceiverWorker.poll(PollingReceiverWorker.java:80) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.transport.PollingReceiverWorker.run(PollingReceiverWorker.java:49) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.transport.TrackingWorkManager$TrackeableWork.run(TrackingWorkManager.java:267) ~[mule-core-3.7.3.jar:3.7.3]
at org.mule.work.WorkerContext.run(WorkerContext.java:286) ~[mule-core-3.7.3.jar:3.7.3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_66]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_66]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_66]
XML
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:ftp="http://www.mulesoft.org/schema/mule/ftp" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" 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
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/current/mule-ftp.xsd">
<http:request-config name="HTTP_Request_Configuration" host="${host}" port="${orderprocess.port}" doc:name="HTTP Request Configuration"></http:request-config>
<sftp:connector name="SFTP" validateConnections="true" doc:name="SFTP"/>
<flow name="orderexperienceFlow" >
<sftp:inbound-endpoint connector-ref="SFTP" host="localhost" port="2222" path="//input" user="${ftp.user}" password="${ftp.password}" responseTimeout="10000" doc:name="SFTP"/>
<dw:transform-message doc:name="Transform Message">
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
payload]]></dw:set-payload>
</dw:transform-message>
<object-to-string-transformer doc:name="Object to String"/>
<logger level="INFO" doc:name="Logger"></logger>
</flow>
</mule>
CSV
1,test
Ответ №1:
Похоже, у вас есть дополнительный /
в path="//input"