gpt4 book ai didi

windows - Mule 文件传输以从 Windows SMB 共享读取文件

转载 作者:可可西里 更新时间:2023-11-01 10:36:45 33 4
gpt4 key购买 nike

我正在尝试将文件写入 Windows SMB 共享。Mule 文件传输文档说我应该能够访问 Windows 位置,如下所示:文件:////192.168.0.1/temp/

这是我的骡子流程:我想知道是否有解决方案。谢谢!

<file:outbound-endpoint   responseTimeout="10000" doc:name="File" address="file:////<IPAddress>/ShareName/" outputPattern="hello.xml"/>

我收到以下错误:

Message               : Streaming failed. Could not get output stream. Failed to route  event via endpoint: DefaultOutboundEndpoint{endpointUri=file:////<IPAddress>/ShareName/,    connector=FileConnector
{
name=connector.file.mule.default
lifecycle=start
this=2b1f76e1
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[file]
serviceOverrides=<none>
}
, name='endpoint.file.<IPAddress>.ShareName', mep=ONE_WAY, properties= {outputPattern=hello.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. No such file or directory (java.io.IOException)
java.io.UnixFileSystem:-2 (null)
2. Streaming failed. Could not get output stream. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=file:////<IPAddress>/ShareName/, connector=FileConnector
{
name=connector.file.mule.default
lifecycle=start
this=2b1f76e1
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[file]
serviceOverrides=<none>
}
, name='endpoint.file.<IPAddress>.ShareName', mep=ONE_WAY, properties={outputPattern=hello.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.file.FileConnector:569 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:883)
at org.mule.util.FileUtils.createFile(FileUtils.java:93)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)

最佳答案

当 Mule 在 Windows 操作系统上执行时,可以使用文件传输来访问 UNC 路径。

由于您似乎在 Unix 机器中,因此您将不得不使用 CIFS/SMB 协议(protocol)。有一个名为 mule-transport-cifs 的社区支持模块可以帮助您解决这个问题。

将此模块添加到您的项目后,您应该可以通过将文件 outbound-enpdoint 更改为类似这样的内容来使用它。

<smb:outbound-endpoint host="<IPAddress>" user="username" password="secret" path="/ShareName" outputPattern="hello.xml"/>

关于windows - Mule 文件传输以从 Windows SMB 共享读取文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21733676/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com