Did you deploy the camel route into some other container ?
If so , can you try to use the absolute path instead of relative path to specify the file which camel file component need to deal with ?
The Camel file component cannot look inside archives such as .jar or .zip files. It can only look from the file system perspective.
If you can locate the file using a command prompt then Camel can find the file as well.
There is Apache Commons VFS project which apparently can look inside archives. Maybe in the future if we got the time, we add this to Camel itself. There is a ticket in JIRA about it.
Thanks for your reply.
I tried placing the data files directly on the filesystem path beside the jar, where camel can find it, however when camel locates it, it sends only the literal filename through the route instead of the file contents.
For instance, if there is a file called data_file.xml which contains data, what is sent is "data_file.xml" string, not the contents of the file. This same route sends data correctly if camel route is not within a jar.
Have you seen this before
What version of camel do you use?
Hmm and you are sure the file is not open by some other programs. It could be that it cannot load the file content and then fallback to its filename instead.
What OS do you use?
The file was not open during camel run.
I am using CentOs Linux.
I was suspected windows as we had an issue beforehand with it, but that was in fact related to moving the file after it was processed.
Does the JVM have permissions on that file system to read / edit / write to that file?
JVM does have those permissions.
Also, for example when the file is not found, camel creates a directory and names it with that filename beside the jar. If the file is found, it sends it's name instead of the contents.
The file component works best if you configure it to scan a folder.
Could you try creating a new empty folder for Camel to use to scan. And then drop your xml file in that folder.
And configure the consumer endpoint as