Question

I am trying to write a file to a Windows SMB share. The Mule File Transport documentation says that I should be able to access a Windows Location as follows: file:////192.168.0.1/temp/

Here is my mule flow: I would like to know if there is a resolution for this. Thanks!

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

I get the following error:

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)

No correct solution

OTHER TIPS

Using the file transport to access a UNC path works when Mule is executing on a Windows operating system.

Since it seems that you are in a Unix machine you will have to use the CIFS/SMB protocol. There is a community supported module called mule-transport-cifs that can help you with this.

After adding this module to your project you should be able to use it by chaning the file outbound-enpdoint to something like this.

<smb:outbound-endpoint host="<IPAddress>" user="username" password="secret" path="/ShareName" outputPattern="hello.xml"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top