I get below error when using file connector to write a file to a working directory (Windows host).
The File connector version is v1.3.4 and mulesoft runtime is 4.3.0
ERROR 2021-07-05 02:13:56,335 [[MuleRuntime].uber.125059: [my-process].inventory-snapshot-file-observer.CPU_LITE #1ee1dd59] [event: 238918e0-dd58-11eb-9534-0050569e1eb4] org.mule.runtime.core.internal.processor.LoggerMessageProcessor:
Error type: FILE:CONNECTIVITY
Error.description: ->Provided workingDir '\\HOST\SCDR-QA$\In' is not a directory<-
However, when I copy the workingDir above and paste into Windows, it can be opened without any issue.
Please share any idea if any, thank you.
The error is correct. '\\HOST\SCDR-QA$\In' is not a directory means that \\host\... is not a path mounted in the local host. It is a format called UNC which is used by Windows to access files remotely via a network protocol, usually the SMB protocol. The File connector can only open files in the same server or host, not over network protocols:
Anypoint Connector for File (File Connector) handles files and folders
on a locally mounted file system.
You can mount the remote path locally using Windows commands so applications can access the remote files with local file operations. You can also try to find an alternative connector for the SMB protocol. There is no official one from MuleSoft. Another alternative could be to develop your own SMB connector, though it probably would take a significant effort.
Related
I am beginner to WebDAV/HTTP protocol. I want to transfer files across network using WebDAV. The source received camera image raw data files has to be placed in a webDAV server (a folder). These files are then copied by a remote client via webDAV. my questions below
Is it necessary to use webDAV/HTTP GET/POST/PUT method calls on the server machine to copy images
or just a normal Linux/QNX command shall work?
If we do not need to go via WebDAV just to copy files then how can we attach properties to these
files like file name and size? are these automatically supplied to remote client by webDAV using
some OS file system calls?
Thank you in advance for your answers
As of now i am downloading the file from SFTP to local and then adding into the database.I want to remove the extra step that is to download the file to machine.
The Text file input step is based on Apache vfs, which can read from a sftp server. So the solution is to define the Filename/Directory with the appropriate syntax:
sftp://[ username[: password]#] hostname[: port][ relative-path]
Supported file systems are on the Apache Common VFS web page.
I have a JAR file and EXE file which I just converted from JAR.
I have put the JAR and EXE together on my website FTP server.
I was wondering if I can read it from the local PC with any
tools(such as HTML, another java file, python or any).
A little bit of description of the JAR or EXE file is:
when it runs on local computer, it gives me a localhost port to access.
So I put something like "localhost:8080" on the web browser for working.
Thank you for your kind advices. :)
You may need to map a network drive
Basically, you need to mount your ftp server as a drive.
I hope this helps.
In my Chef recipes I use remote_file to access files at http server. I would like to use Chef server's ngnix to serve those files.
How to configure Chef's nginx to serve files in specific folder using http?
This is not a feature of Chef. You can use the files/ folder in a cookbook and the cookbook_file resource to serve files directly from the Chef Server but it is very limited and you should really use your own server to manage large files or complex downloads.
We have many machines in LAN to be configured with Chef. There are also many remote_file resources in our recipes. The problem was: downloading from internet takes a lot of time, but at the same time the file was available on another machine in LAN.
What I did is:
Installed Nexus for binary file storage.
Monkeypatched remote_file resource using a library in a cookbook, so that it gets loaded every time a cookbook is loaded overwriting original resource behaviour.
Now every time remote_file resource has to download some file, it will first ask Nexus. If that file is available in Nexus, it downloads from there.
If there is no such file there, Chef downloads the file from original source and then uploads it to Nexus too for other nodes.
I am using apache-servicemix-4.3.1-fuse-01-15 and I am doing hot deployment.
I have placed one blueprint xml inside deploy folder of service-mix as shown below
<blueprint
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="file://D:/apache-servicemix-4.3.1-fuse-01-15/apache-servicemix-4.3.1-fuse-01-15/source/?recursive=true" /><!--sample path of source folder-->
<to uri="file:////192.168.68.215/Fuse"/><!--sample path of destination folder-->
</route>
</camelContext>
</blueprint>
As you can see I want to transfer files to another computer from my local pc.But in the log it is giving following error, though I have acess to the path mentioned in to.
Caused by: java.io.FileNotFoundException: \\192.168.68.215\Fuse\core_logs-12012012\core-logs_20110908 - Copy - Copy (4)\core-logs_20110908.log (The system cannot find the path specified)
If I replace the IP with my local directory path, it is working fine.
I am curious to know what went wrong here.
Shall I use ftp,sftps or ftp. Is it the case that what I am doing will never work.Do I need to mentioned username and password.
If you want to transfer files between computers, you would need to use a protocol that supports that such as:
file
ftp
scp
As you use windows, you can use the file system by setting up a network shared connection from your computer to the remote computer. eg mount the remote computer as if it was a local drive (eg H: or any free letter). Eg basically if you can get it working so you can see the remote computer using the Windows File Explorer. Hint: The file component in Camel uses Java's java.io.File API. So whatever you can get working with that, is supported then.
FTP would require the other computer to have a FTP server.
SCP is often not supported on Windows, and you would need to install software to support that.
i am not sure if camel file component which is using java's file api can do this out of the box . But if you are hell bent on using a camel route for doing this , you can write a custom bean in the part which takes in the file/filepath and copies it to the remote machine via sftp or scp as claus mentioned
if it is a linux machine you can easily do sftp/scp via jsch , check the examples
if its a window machine you can setup a ftp server and use apache commons VFS