[ https://issues.apache.org/jira/browse/CAMEL-6069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Anders Holmgren updated CAMEL-6069: ----------------------------------- Description: We recently upgraded to 2.10.x and discovered that the file poller no longer works on our NAS. We have hit similar issues with other open source libraries in the past. The problem occurs when MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock is called and tries to create the new file. This actually works but also results in a Permission denied IOException (strange but true). A simple fix for this is to change the acquireExclusiveReadLock method as follows. {code} public boolean acquireExclusiveReadLock(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception { String lockFileName = getLockFileName(file); LOG.trace("Locking the file: {} using the lock file name: {}", file, lockFileName); // create a plain file as marker filer for locking (do not use FileLock) File lock = new File(lockFileName); boolean acquired = false; try { acquired = lock.createNewFile(); } catch (IOException e) { if (lock.exists()) { acquired = true; } else { throw e; } } return acquired; } {code} Note the same problem occurring with Spring Batch can be found [here|https://jira.springsource.org/browse/BATCH-1659] was: We recently upgraded to 2.10.x and discovered that the file poller no longer works on our NAS. We have hit similar issues with other open source libraries in the past. The problem occurs when MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock is called and tries to create the new file. This actually works but also results in a Permission denied IOException (strange but true). A simple fix for this is to change the acquireExclusiveReadLock method as follows. public boolean acquireExclusiveReadLock(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception { String lockFileName = getLockFileName(file); LOG.trace("Locking the file: {} using the lock file name: {}", file, lockFileName); // create a plain file as marker filer for locking (do not use FileLock) File lock = new File(lockFileName); boolean acquired = false; try { acquired = lock.createNewFile(); } catch (IOException e) { if (lock.exists()) { acquired = true; } else { throw e; } } return acquired; } Note the same problem occurring with Spring Batch can be found [here|https://jira.springsource.org/browse/BATCH-1659] > java.io.IOException: Permission denied from > MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock on NAS > --------------------------------------------------------------------------------------------------------------- > > Key: CAMEL-6069 > URL: https://issues.apache.org/jira/browse/CAMEL-6069 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.10.3 > Reporter: Anders Holmgren > > We recently upgraded to 2.10.x and discovered that the file poller no longer > works on our NAS. We have hit similar issues with other open source libraries > in the past. > The problem occurs when > MarkerFileExclusiveReadLockStrategy.acquireExclusiveReadLock is called and > tries to create the new file. This actually works but also results in a > Permission denied IOException (strange but true). > A simple fix for this is to change the acquireExclusiveReadLock method as > follows. > {code} > public boolean acquireExclusiveReadLock(GenericFileOperations<File> > operations, > GenericFile<File> file, Exchange > exchange) throws Exception { > String lockFileName = getLockFileName(file); > LOG.trace("Locking the file: {} using the lock file name: {}", file, > lockFileName); > // create a plain file as marker filer for locking (do not use > FileLock) > File lock = new File(lockFileName); > boolean acquired = false; > try > { > acquired = lock.createNewFile(); > } > catch (IOException e) > { > if (lock.exists()) > { > acquired = true; > } > else > { > throw e; > } > } > return acquired; > } > {code} > Note the same problem occurring with Spring Batch can be found > [here|https://jira.springsource.org/browse/BATCH-1659] -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira