camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shiraz.Iskenderian" <>
Subject GenericFileOperationFailedException - 'Cannot rename file' on Linux
Date Tue, 06 Sep 2016 06:29:02 GMT

We have an integration system based on Camel v2.16.1 that runs on a Jboss v6
Linux platform.  There are multiple interfaces running simultaneously each
with a different polling rate.

We are intermittently experiencing 'Cannot rename file' issue with Camel
failing to backup to the 'done' folder successfully processed and
transmitted files from the ftp source.  Restarting the camel application
fixes the issue.

Basically, at regular intervals triggered by a quartz scheduler, the route: 
1) picks up files from a source via ftp,
2) processes them, smooks + xsl transformations
3) delivers the generated flat file to an endpoint via ftp.

If multiple files are read from the source directory, then all the files are
appended together in a temporary file before being processed.

The Camel ftp configuration uses the following url:


a) read files dsciord_*.dat from /export directory
b) use custom inprogressRepository to store the read filename into a local
db (this was done to prevent contention issue with a second cluster node,
however, currently only a single node is live.  This option is unnecessary
and can be removed speeding up the process).
c) move files to an in_progress_bpo/201609061522 directory, where the
subdirectory is created based on the date_timestamp.  
d) move them to the in_progress_bpo/201609061522/done subdirectory once
successfully processed.

In vast majority of cases the route works with no issues, however, sometimes
the file(s) cannot be moved to the done folder (see error below).  Even in
this case, the route can sometimes continue successfully at the next polling
cycle, however, in other cases the route enters a state when even if the
quartz scheduler triggers the poll, the route fails to detect any files in
the source /export directory even when there ARE files there.

org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
rename file: RemoteFile[in_progress_bpo/201609060502/dsciord_3605752.dat]
to: RemoteFile[in_progress_bpo/201609060502/done/dsciord_3605752.dat]

Notes: We are using 
1) a single instance of a ConsumerTemplate to handle our interfaces.
2) a custom inprogressRepository to store the file names read.

Obviously, there must be a system locking the source files and this is
causing the Camel route to stop processing further files.

Any ideas/suggestions on debugging/resolving this issue would be greatly
appreciated.  The issues that I read through the camel-users forum seem to
deal with Windows-related deployments, sometimes Smooks failing to close the
input stream.  I've check and we don't use the 
org.milyn.templating.xslt.XslTemplateProcessor#bypass method where Smooks
fails to close the underlying input stream.

Thanks in advance,
Shiraz Iskenderian
Melbourne, Australia

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message