Hi Raul,

  I've attached the test file that I used as well as the log from the
test in my prior message.  I pasted the exception as well in case you
have difficulty with the attachments.

  This is a 2.10 problem - I ran the exact same test with 2.9.1 and
both routes in the test succeeded.  What changed in 2.10 from 2.9.1?

Phil
====
120 [main] INFO com.bglobal.etf.dixie.camel.route.impl.FileMoveTest -
********************************************************************************
130 [main] INFO com.bglobal.etf.dixie.camel.route.impl.FileMoveTest -
Testing: testRoute(com.bglobal.etf.dixie.camel.route.impl.FileMoveTest)
130 [main] INFO com.bglobal.etf.dixie.camel.route.impl.FileMoveTest -
********************************************************************************
381 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache
Camel 2.10.0 (CamelContext: camel-1) is starting
381 [main] INFO org.apache.camel.management.ManagementStrategyFactory
- JMX is disabled.
601 [main] INFO org.apache.camel.impl.converter.DefaultTypeConverter -
Loaded 186 type converters
831 [main] INFO org.apache.camel.impl.DefaultCamelContext - Route:
route1 started and consuming from:
Endpoint[file://c:/fileMoveTest/in?charset=UTF-8&delay=5000&include=.*%5C.csv%24&move=.processed&moveFailed=.failed&readLock=rename]
831 [main] INFO org.apache.camel.impl.DefaultCamelContext - Total 1
routes, of which 1 is started.
831 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache
Camel 2.10.0 (CamelContext: camel-1) started in 0.450 seconds
52077 [Camel (camel-1) thread #0 - file://c:/fileMoveTest/in] INFO
org.apache.camel.component.file.remote.RemoteFileProducer - Connected
and logged in to:
Endpoint[ftp://anonymous@ftpTest/test?delay=5000&password=******&throwExceptionOnConnectFailed=true]
56596 [Camel (camel-1) thread #0 - file://c:/fileMoveTest/in] WARN
org.apache.camel.component.file.GenericFileOnCompletion - Caused by:
[org.apache.camel.component.file.GenericFileOperationFailedException -
Error renaming file from c:\fileMoveTest\in\test.csv to
c:\fileMoveTest\in\.processed\test.csv]
org.apache.camel.component.file.GenericFileOperationFailedException:
Error renaming file from c:\fileMoveTest\in\test.csv to
c:\fileMoveTest\in\.processed\test.csv
        at 
org.apache.camel.component.file.FileOperations.renameFile(FileOperations.java:72)
        at 
org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:107)
        at 
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:86)
        at 
org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:132)
        at 
org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:82)
        at 
org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:53)
        at 
org.apache.camel.util.UnitOfWorkHelper.doneSynchronizations(UnitOfWorkHelper.java:55)
        at 
org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:226)
        at 
org.apache.camel.processor.UnitOfWorkProcessor.doneUow(UnitOfWorkProcessor.java:199)
        at 
org.apache.camel.processor.UnitOfWorkProcessor.access$000(UnitOfWorkProcessor.java:37)
        at 
org.apache.camel.processor.UnitOfWorkProcessor$1.done(UnitOfWorkProcessor.java:157)
        at 
org.apache.camel.processor.RouteContextProcessor$1.done(RouteContextProcessor.java:56)
        at 
org.apache.camel.processor.RouteContextProcessor$1.done(RouteContextProcessor.java:56)
        at 
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:361)
        at 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
        at 
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
        at 
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at 
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)
        at 
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
        at 
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at 
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
        at 
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
        at 
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
        at 
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at 
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        at 
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        at 
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at 
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
        at 
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:336)
        at 
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:189)
        at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:155)
        at 
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:139)
        at 
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:91)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at 
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: Renaming file from:
c:\fileMoveTest\in\test.csv to: c:\fileMoveTest\in\.processed\test.csv
failed due cannot delete from file: c:\fileMoveTest\in\test.csv after
copy succeeded
        at org.apache.camel.util.FileUtil.renameFile(FileUtil.java:362)
        at 
org.apache.camel.component.file.FileOperations.renameFile(FileOperations.java:70)
        ... 41 more


On Thu, Aug 9, 2012 at 4:57 AM, Raul Kripalani [via Camel]
<ml-node+s465427n5717061...@n5.nabble.com> wrote:
> What's the name of the file and what exception do you see?
>
> Regards,
>
> *Raúl Kripalani*
> *Principal Consultant | FuseSource Corp.
> [hidden email] | fusesource.com <http://www.fusesource.com/>
> skype: raul.fuse | twitter: @raulvk <http://twitter.com/raulvk>,
> @fusenews<http://twitter.com/fusenews>
> *
> blog: F3 - Flashes From the
> Field<http://blog.raulkr.net/?utm_source=fusesourceemail&utm_medium=email&utm_campaign=fusesourcemail>
>  | aboutme: http://about.me/raulkripalani
>
> <http://twitter.com/fusenews>
>
> On 8 August 2012 22:33, pglebow <[hidden email]> wrote:
>
>> I'm struggling with a very odd issue with Camel 2.10 and I'm hoping
>> someone
>> could explain why it's occurring.  I've attached a test case that
>> demonstrates the issue.  It is a very simple route - just take a file from
>> a
>> local directory and FTP it to a server.  Here is the problem:
>>
>> When I specify the character set in the file producer, Camel cannot rename
>> the file from the source directory to the .processed directory (.move
>> directory).  It is unable to acquire an exclusive file lock.
>>
>> However, when I remove the charset=UTF-8 parameter, everything works
>> properly.  The file is FTPed and is moved to the .processed directory.
>>
>> Why does the character encoding cause an issue with read locks?  Am I
>> doing
>> something incorrect or is this a bug?  I'm using Camel 2.10 and Java
>> 1.6.0_33 under Windows 7.
>>
>> ------------
>> - Test case
>> ------------
>> package com.comp.test.camel.route.impl;
>>
>> import junit.framework.Assert;
>>
>> import org.apache.camel.builder.RouteBuilder;
>> import org.apache.camel.test.junit4.CamelTestSupport;
>> import org.apache.commons.logging.Log;
>> import org.apache.commons.logging.LogFactory;
>> import org.junit.Test;
>>
>> public class FileMoveTest extends CamelTestSupport {
>>
>>     protected Log log = LogFactory.getLog(FileMoveTest.class);
>>
>>     @Test
>>     public void testRoute() throws Exception {
>>         try {
>>             Thread.sleep(140000);
>>         } catch (Exception e) {
>>             log.error(e.getMessage(), e);
>>             Assert.fail(e.getMessage());
>>         }
>>
>>     }
>>
>>     /*
>>      * (non-Javadoc)
>>      *
>>      * @see
>> org.apache.camel.test.junit4.CamelTestSupport#createRouteBuilder()
>>      */
>>     @Override
>>     protected RouteBuilder createRouteBuilder() throws Exception {
>>         return new RouteBuilder() {
>>
>>             @Override
>>             public void configure() throws Exception {
>>                 // Works
>>                 //
>>
>>
>> from("file://c:/fileMoveTest/in?move=.processed&moveFailed=.failed&delay=5000&readLock=rename&include=.*\\.csv$").to(
>>                 //
>> "ftp://anonymous@ftpTest
>> /test?password=anonymous&delay=5000&throwExceptionOnConnectFailed=true");
>>
>>                 // Fails
>>
>>
>>
>> from("file://c:/fileMoveTest/in?charset=UTF-8&move=.processed&moveFailed=.failed&delay=5000&readLock=rename&include=.*\\.csv$").to(
>>
>> "ftp://anonymous@ftpTest
>> /test?password=anonymous&delay=5000&throwExceptionOnConnectFailed=true");
>>             }
>>         };
>>     }
>> }
>>
>>
>>
>>
>> --
>> View this message in context:
>>
>> http://camel.465427.n5.nabble.com/Character-set-issue-with-File-Consumer-FTP-Publication-tp5717025.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Character-set-issue-with-File-Consumer-FTP-Publication-tp5717025p5717061.html
> To unsubscribe from Character set issue with File Consumer & FTP
> Publication, click here.
> NAML




--
View this message in context: 
http://camel.465427.n5.nabble.com/Character-set-issue-with-File-Consumer-FTP-Publication-tp5717025p5717077.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to