面对在ftp mule上传输文件的问题

时间:2014-11-25 09:23:41

标签: salesforce mule mule-studio

我将文件传输到ftp服务器时遇到问题。 以下是我的代码

<sfdc:config name="Salesforce" username="myUserName" password="pwd" securityToken="mytokens" doc:name="Salesforce"/>
    <file:connector name="File" autoDelete="true" streaming="true" validateConnections="true" doc:name="File"/>
    <data-mapper:config name="List_Contact__To_CSV" transformationGraphPath="list_contact__to_csv.grf" doc:name="List_Contact__To_CSV"/>
    <ftp:connector name="ftpConnector"   streaming="true" doc:name="FTP"/>
    <batch:job name="Batch1">
        <batch:threading-profile poolExhaustedAction="WAIT"/>
        <batch:input>
            <poll doc:name="Poll">
                <fixed-frequency-scheduler frequency="2" timeUnit="MINUTES"/>
                <sfdc:query config-ref="Salesforce" query="dsql:SELECT Email,Name FROM Contact" fetchSize="20" doc:name="Salesforce"/>
            </poll>
        </batch:input>
        <batch:process-records>
            <batch:step name="Batch_Step">
                <batch:commit size="20" doc:name="Batch Commit">
                    <data-mapper:transform config-ref="List_Contact__To_CSV" doc:name="List&lt;Contact&gt; To CSV"/>
                    <file:outbound-endpoint path="/home/Desktop/Input" outputPattern="test.csv" connector-ref="File" responseTimeout="10000" doc:name="File"/>
                    <logger level="INFO" doc:name="Logger"/>
                    <ftp:outbound-endpoint path="myPath" host="208.115.etc.." port="21" user="name@client.test.in" password="pwd" outputPattern="test.csv" connector-ref="ftpConnector" mimeType="application/csv" responseTimeout="10000" doc:name="ftp"/>
                </batch:commit>
            </batch:step>
        </batch:process-records>
    </batch:job>

我的文件已成功保存在桌面上,但未在我的ftp服务器上传输。我收到了以下错误

-------------------------------------------------------------------------------
Exception stack is:
1. hostname can't be null (java.lang.IllegalArgumentException)
  java.net.InetSocketAddress:149 (null)
2. hostname can't be null (java.lang.IllegalArgumentException) (org.mule.transport.ConnectException)
  org.mule.transport.ftp.FtpConnector:552 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/transport/ConnectException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.IllegalArgumentException: hostname can't be null

解决方案是什么帮助我

1 个答案:

答案 0 :(得分:0)

由于您的登录凭据包含@,因此必须使用%40转义它。 尝试将您的用户更改为user =“name%40client.test.in”