You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Nick Mitchell <ni...@hmv.co.uk> on 2010/04/06 18:55:16 UTC

FileComponent Camel 2.2

Hi, 

Apologies I posted this on the camel development forum too, but then
realised that might be the wrong place.

We've been using the file component for a while with camel version 2.0, and
it has successfully moved files into a sub directory called .camel once they
have been processed. We are in the process of trying to upgrade to version
2.2 but are experiencing some issues. The problem we are finding is that the
file component is now looking for the .camel directory in the server root
i.e. as an absolute path instead of a relative path. Obviously the directory
does not exist and it is throwing an exception, see below. Any help would be
appreciated. 

 [: FileComponent] ERROR GenericFileOnCompletion        - Caused by:
[org.apache.camel.component.file.GenericFileOperationFailedException -
Cannot rename file: GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL UNDER NDA
SampleCrMetadata-20091216.xml] to: GenericFile[/.camel/]] 
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
rename file: GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL UNDER NDA
SampleCrMetadata-20091216.xml] to: GenericFile[/.camel/] 
        at
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96) 
        at
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:72) 
        at
org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:122) 
        at
org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:83) 
        at
org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:52) 
        at
org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:145) 
        at
org.apache.camel.processor.UnitOfWorkProcessor.done(UnitOfWorkProcessor.java:82) 
        at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:71) 
        at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48) 
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67) 
        at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:258) 
        at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:137) 
        at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:103) 
        at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:106) 
        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:181) 
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) 
        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:619) 

Thanks 
Nick
-- 
View this message in context: http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28154602.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FileComponent Camel 2.2

Posted by Nick Mitchell <ni...@hmv.co.uk>.
I'm working through the source code and I can see

boolean renamed = operations.renameFile(from.getAbsoluteFilePath(),
to.getAbsoluteFilePath());
        if (!renamed) {
            throw new GenericFileOperationFailedException("Cannot rename
file: " + from + " to: " + to);
        }

This implies it always uses the absolute file path instead of the relative
file path ?

Nick
-- 
View this message in context: http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28163859.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FileComponent Camel 2.2

Posted by Nick Mitchell <ni...@hmv.co.uk>.
Many thanks for getting back to me.

Right finally worked it out, I found that the CleanExchange processor at the
end of the route was clearing the body and header of the exchange. If I
remove this processor then it works fine again. I'm now trying to track down
with the developer why they did that.

Cheers
Nick
-- 
View this message in context: http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28165108.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FileComponent Camel 2.2

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I recon there is something in all you code that messes up the Camel headers.
You could just try a very simple route to see if it can pickup the
files and just move them to .camel

Here is output from my test

/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin/java
-Dfile.encoding=MacRoman -classpath /Applications/IntelliJ IDEA 9.0
CE.app/plugins/junit/lib/junit-rt.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/deploy.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/dt.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/plugin.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/sa-jdi.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/charsets.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jconsole.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/laf.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/apple_provider.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/dnsns.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/localedata.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/sunjce_provider.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/sunpkcs11.jar:/workspace/camel/camel-core/target/test-classes:/workspace/camel/camel-core/target/classes:/Users/davsclaus/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar:/Users/davsclaus/.m2/repository/org/fusesource/commonman/commons-management/1.0/commons-management-1.0.jar:/Users/davsclaus/.m2/repository/org/springframework/spring-context/2.5.6/spring-context-2.5.6.jar:/Users/davsclaus/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:/Users/davsclaus/.m2/repository/junit/junit/3.8.2/junit-3.8.2.jar:/Users/davsclaus/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar:/Users/davsclaus/.m2/repository/org/springframework/spring-aop/2.5.6/spring-aop-2.5.6.jar:/Users/davsclaus/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/Users/davsclaus/.m2/repository/org/springframework/spring-beans/2.5.6/spring-beans-2.5.6.jar:/Users/davsclaus/.m2/repository/org/springframework/spring-core/2.5.6/spring-core-2.5.6.jar:/Users/davsclaus/.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar:/Users/davsclaus/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar:/Users/davsclaus/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar:/Users/davsclaus/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.12/jaxb-impl-2.1.12.jar:/Applications/IntelliJ
IDEA 9.0 CE.app/lib/idea_rt.jar
com.intellij.rt.execution.junit.JUnitStarter -ideVersion5
org.apache.camel.component.file.FileAbsoluteMoveDefaultIssueTest
2010-04-07 14:08:20,460 [main           ] INFO  DefaultCamelContext
        - Apache Camel  (CamelContext: camel-1) is starting
2010-04-07 14:08:20,461 [main           ] INFO  DefaultCamelContext
        - JMX is disabled. Using DefaultManagementStrategy.
2010-04-07 14:08:20,902 [main           ] INFO  DefaultCamelContext
        - Route: route1 started and consuming from:
Endpoint[file:///opt/feeds/ebook/in?include=.*%5C.txt&sortBy=file%3Aname]
2010-04-07 14:08:20,903 [main           ] INFO  DefaultCamelContext
        - Started 1 routes
2010-04-07 14:08:20,904 [main           ] INFO  DefaultCamelContext
        - Apache Camel  (CamelContext: camel-1) started
2010-04-07 14:08:20,936 [main           ] INFO  MockEndpoint
        - Asserting: Endpoint[mock://result] is satisfied
2010-04-07 14:08:21,917 [tBy=file%3Aname] INFO  foo
        - Exchange[Id:152d5d0c-f13d-443c-a39b-022c67baa5bb,
ExchangePattern:InOnly, Properties:{CamelBatchComplete=true,
CamelToEndpoint=log://foo?showAll=true, CamelBatchSize=1,
CamelFileLock=/opt/feeds/ebook/in/hello.txt.camelLock,
CamelBatchIndex=0,
CamelFileExchangeFile=GenericFile[/opt/feeds/ebook/in/hello.txt],
CamelFileLockName=/opt/feeds/ebook/in/hello.txt.camelLock},
Headers:{FILE_ID=hello, CamelFileLastModified=Wed Apr 07 14:08:20 CEST
2010, CamelFileRelativePath=/opt/feeds/ebook/in/hello.txt,
CamelFileAbsolute=true, CamelFileNameOnly=hello.txt,
CamelFilePath=/opt/feeds/ebook/in/hello.txt, CamelFileName=hello.txt,
CamelFileParent=/opt/feeds/ebook/in, CamelFileLength=11,
CamelFileAbsolutePath=/opt/feeds/ebook/in/hello.txt}, BodyType:String,
Body:Hello World, Out: null]
2010-04-07 14:08:21,924 [tBy=file%3Aname] TRACE GenericFile
        - Changing name to: /opt/feeds/ebook/in/.camel/hello.txt
2010-04-07 14:08:21,924 [main           ] INFO  DefaultCamelContext
        - Apache Camel  (CamelContext:camel-1) is shutting down
2010-04-07 14:08:21,929 [tBy=file%3Aname] TRACE GenericFile
        - Normalized endpointPath: /opt/feeds/ebook/in
2010-04-07 14:08:21,930 [tBy=file%3Aname] TRACE GenericFile
        - Normalized newFileName: /opt/feeds/ebook/in/.camel/hello.txt
2010-04-07 14:08:21,929 [main           ] INFO
DefaultShutdownStrategy        - Starting to graceful shutdown 1
routes (timeout 10 seconds)
2010-04-07 14:08:21,930 [tBy=file%3Aname] TRACE GenericFile
        - FileNameOnly: hello.txt
2010-04-07 14:08:21,931 [tBy=file%3Aname] TRACE GenericFile
        - FileName: hello.txt
2010-04-07 14:08:21,932 [tBy=file%3Aname] TRACE GenericFile
        - Absolute: true
2010-04-07 14:08:21,932 [tBy=file%3Aname] TRACE GenericFile
        - Relative path: /opt/feeds/ebook/in/.camel/hello.txt
2010-04-07 14:08:21,932 [tBy=file%3Aname] TRACE GenericFile
        - Absolute path: /opt/feeds/ebook/in/.camel/hello.txt
2010-04-07 14:08:21,933 [tBy=file%3Aname] TRACE GenericFile
        - Name changed to:
GenericFile[/opt/feeds/ebook/in/.camel/hello.txt]
2010-04-07 14:08:21,933 [ - ShutdownTask] INFO
DefaultShutdownStrategy        - Route: route1 suspended and shutdown
deferred, was consuming from:
Endpoint[file:///opt/feeds/ebook/in?include=.*%5C.txt&sortBy=file%3Aname]
2010-04-07 14:08:21,935 [ - ShutdownTask] INFO
DefaultShutdownStrategy        - Route: route1 shutdown complete.
2010-04-07 14:08:21,935 [main           ] INFO
DefaultShutdownStrategy        - Graceful shutdown of 1 routes
completed in 0 seconds
2010-04-07 14:08:21,936 [main           ] INFO
DefaultInflightRepository      - Shutting down with no inflight
exchanges.
2010-04-07 14:08:21,937 [main           ] INFO  DefaultCamelContext
        - Apache Camel  (CamelContext: camel-1) is shutdown

Process finished with exit code 0

In a simple uni tests

public class FileAbsoluteMoveDefaultIssueTest extends ContextTestSupport {

    @Override
    protected void setUp() throws Exception {
        deleteDirectory("opt/feeds/");
        super.setUp();
    }

    public void testAbsolute() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World");
        mock.expectedFileExists("/opt/feeds/ebook/in/.camel/hello.txt");

        template.sendBodyAndHeader("file:/opt/feeds/ebook/in", "Hello
World", Exchange.FILE_NAME, "hello.txt");

        assertMockEndpointsSatisfied();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {

from("file:/opt/feeds/ebook/in?sortBy=file:name&include=.*\\.txt")
                        .convertBodyTo(String.class)
                        .setHeader("FILE_ID",
SimpleLanguage.simple("${file:onlyname.noext}"))
                        .to("log:foo?showAll=true")
                        .to("mock:result");
            }
        };
    }
}





On Wed, Apr 7, 2010 at 2:06 PM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> Try using the Tracer and/or add this logging to the end of your route
>                        .to("log:foo?showAll=true")
>
> It could be something in all your processors and whatnot which messes
> with the headers.
>
> I have created an unit test on my system and it works all the time.
>
>
>
> On Wed, Apr 7, 2010 at 11:35 AM, Nick Mitchell <ni...@hmv.co.uk> wrote:
>>
>> from(cronTriggerExpression)
>>                       .pollEnrich(ebookRemoteFTPIn,0)
>>        .idempotentConsumer(header("CamelFileName"),filenameRepository)
>>                .to(ebookIn);
>>
>>           from(ebookIn)
>>                        .process( new SetupChildRouteRuntime(metaRouteId,childRouteId+0,
>> baseDao) )
>>                        .unmarshal(new XMLebookDataFormat())
>>                        .process(new CSVebookProcessor(ebookOut,
>>                                                                ebookTable,
>>                                                                authorTable,
>>                                                                drminfoTable,
>>                                                        ebookSubjectTable,
>>                                                        abstractBook2BiccodeTable,
>>                                                        bisacBicDao,
>>                                                        bicClassificationDao,
>>                                                        ebooksOtherFormatsTable,
>>                                                        ebooksExcerptTable,
>>                                                        ebookDigitalInfoTable,
>>                                                        ebooksOtherTitlesTable,
>>                                                        publisherTable,
>>                                                        imprintTable,
>>                                                        catalogDao,
>>                                                        productDao,
>>                                                        composedTypeDao,
>>                                                        etlStats,
>>                                                        true,
>>                                                        currentVatRate
>>                                                                ) )
>>        .setHeader("FILE_ID",
>> SimpleLanguage.simple("${file:onlyname.noext}"))
>>        .process(new ZipProcessorHybris(ebookOut, ebookZipOut,
>> ebookOutFileName, true, ebookZipIn,
>>                        0L, "[_.]","_{0}_{date}",etlStats))
>>        .process(new EmailProcessor(mailService,etlStats,ebookZipIn))
>>        .process( new EtlProcessSuccess(baseDao))
>>            .process(new CleanExchange())
>>            .delay().method( "com.lbi.etl.utils.beans.Delayer", "forceGC" );
>>
>> I've tried to fill in some constants so it makes a bit more sense to you.
>> The processors in the route don't really do much. Basically the route polls
>> for an XML file, processes the XML file, converts to a csv format, puts the
>> output file in a different directory and emails to say successful.
>>
>> Cheers
>> Nick
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> Hi
>>>
>>> Could you post your route? I will then use it to reproduce the issue
>>> on my laptop.
>>>
>>>
>>> On Wed, Apr 7, 2010 at 10:45 AM, Nick Mitchell <ni...@hmv.co.uk>
>>> wrote:
>>>>
>>>> We are setting FILE_ID in the header
>>>>
>>>> .setHeader(FILE_ID, SimpleLanguage.simple("${file:onlyname.noext}"))
>>>>
>>>> If I change the file expression to ${file:name.ext} then it does move it
>>>> to
>>>> .camel folder. I confused as to why it worked before and not now though.
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28162146.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>>
>>>
>>
>> --
>> View this message in context: http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28162632.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: FileComponent Camel 2.2

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Try using the Tracer and/or add this logging to the end of your route
                        .to("log:foo?showAll=true")

It could be something in all your processors and whatnot which messes
with the headers.

I have created an unit test on my system and it works all the time.



On Wed, Apr 7, 2010 at 11:35 AM, Nick Mitchell <ni...@hmv.co.uk> wrote:
>
> from(cronTriggerExpression)
>                       .pollEnrich(ebookRemoteFTPIn,0)
>        .idempotentConsumer(header("CamelFileName"),filenameRepository)
>                .to(ebookIn);
>
>           from(ebookIn)
>                        .process( new SetupChildRouteRuntime(metaRouteId,childRouteId+0,
> baseDao) )
>                        .unmarshal(new XMLebookDataFormat())
>                        .process(new CSVebookProcessor(ebookOut,
>                                                                ebookTable,
>                                                                authorTable,
>                                                                drminfoTable,
>                                                        ebookSubjectTable,
>                                                        abstractBook2BiccodeTable,
>                                                        bisacBicDao,
>                                                        bicClassificationDao,
>                                                        ebooksOtherFormatsTable,
>                                                        ebooksExcerptTable,
>                                                        ebookDigitalInfoTable,
>                                                        ebooksOtherTitlesTable,
>                                                        publisherTable,
>                                                        imprintTable,
>                                                        catalogDao,
>                                                        productDao,
>                                                        composedTypeDao,
>                                                        etlStats,
>                                                        true,
>                                                        currentVatRate
>                                                                ) )
>        .setHeader("FILE_ID",
> SimpleLanguage.simple("${file:onlyname.noext}"))
>        .process(new ZipProcessorHybris(ebookOut, ebookZipOut,
> ebookOutFileName, true, ebookZipIn,
>                        0L, "[_.]","_{0}_{date}",etlStats))
>        .process(new EmailProcessor(mailService,etlStats,ebookZipIn))
>        .process( new EtlProcessSuccess(baseDao))
>            .process(new CleanExchange())
>            .delay().method( "com.lbi.etl.utils.beans.Delayer", "forceGC" );
>
> I've tried to fill in some constants so it makes a bit more sense to you.
> The processors in the route don't really do much. Basically the route polls
> for an XML file, processes the XML file, converts to a csv format, puts the
> output file in a different directory and emails to say successful.
>
> Cheers
> Nick
>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> Could you post your route? I will then use it to reproduce the issue
>> on my laptop.
>>
>>
>> On Wed, Apr 7, 2010 at 10:45 AM, Nick Mitchell <ni...@hmv.co.uk>
>> wrote:
>>>
>>> We are setting FILE_ID in the header
>>>
>>> .setHeader(FILE_ID, SimpleLanguage.simple("${file:onlyname.noext}"))
>>>
>>> If I change the file expression to ${file:name.ext} then it does move it
>>> to
>>> .camel folder. I confused as to why it worked before and not now though.
>>> --
>>> View this message in context:
>>> http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28162146.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28162632.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: FileComponent Camel 2.2

Posted by Nick Mitchell <ni...@hmv.co.uk>.
from(cronTriggerExpression) 
		       .pollEnrich(ebookRemoteFTPIn,0) 
        .idempotentConsumer(header("CamelFileName"),filenameRepository)		       
	   	.to(ebookIn);

	   from(ebookIn)
		   	.process( new SetupChildRouteRuntime(metaRouteId,childRouteId+0,
baseDao) )
		   	.unmarshal(new XMLebookDataFormat())
		   	.process(new CSVebookProcessor(ebookOut,
        							ebookTable,
        							authorTable,
        							drminfoTable,
        				    		ebookSubjectTable,
        				    		abstractBook2BiccodeTable,
        				    		bisacBicDao,
        				    		bicClassificationDao,
        				    		ebooksOtherFormatsTable,
        				    		ebooksExcerptTable,
        				    		ebookDigitalInfoTable,
        				    		ebooksOtherTitlesTable,
        				    		publisherTable,
        				    		imprintTable,
        				    		catalogDao,
        				    		productDao,
        				    		composedTypeDao,
        				    		etlStats,
        				    		true,
        				    		currentVatRate
        							) )
        .setHeader("FILE_ID",
SimpleLanguage.simple("${file:onlyname.noext}"))
        .process(new ZipProcessorHybris(ebookOut, ebookZipOut,
ebookOutFileName, true, ebookZipIn,
        		0L, "[_.]","_{0}_{date}",etlStats))
        .process(new EmailProcessor(mailService,etlStats,ebookZipIn))
        .process( new EtlProcessSuccess(baseDao))
	    .process(new CleanExchange())
	    .delay().method( "com.lbi.etl.utils.beans.Delayer", "forceGC" );

I've tried to fill in some constants so it makes a bit more sense to you.
The processors in the route don't really do much. Basically the route polls
for an XML file, processes the XML file, converts to a csv format, puts the
output file in a different directory and emails to say successful.

Cheers
Nick


Claus Ibsen-2 wrote:
> 
> Hi
> 
> Could you post your route? I will then use it to reproduce the issue
> on my laptop.
> 
> 
> On Wed, Apr 7, 2010 at 10:45 AM, Nick Mitchell <ni...@hmv.co.uk>
> wrote:
>>
>> We are setting FILE_ID in the header
>>
>> .setHeader(FILE_ID, SimpleLanguage.simple("${file:onlyname.noext}"))
>>
>> If I change the file expression to ${file:name.ext} then it does move it
>> to
>> .camel folder. I confused as to why it worked before and not now though.
>> --
>> View this message in context:
>> http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28162146.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28162632.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FileComponent Camel 2.2

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Could you post your route? I will then use it to reproduce the issue
on my laptop.


On Wed, Apr 7, 2010 at 10:45 AM, Nick Mitchell <ni...@hmv.co.uk> wrote:
>
> We are setting FILE_ID in the header
>
> .setHeader(FILE_ID, SimpleLanguage.simple("${file:onlyname.noext}"))
>
> If I change the file expression to ${file:name.ext} then it does move it to
> .camel folder. I confused as to why it worked before and not now though.
> --
> View this message in context: http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28162146.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: FileComponent Camel 2.2

Posted by Nick Mitchell <ni...@hmv.co.uk>.
We are setting FILE_ID in the header

.setHeader(FILE_ID, SimpleLanguage.simple("${file:onlyname.noext}"))

If I change the file expression to ${file:name.ext} then it does move it to
.camel folder. I confused as to why it worked before and not now though.
-- 
View this message in context: http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28162146.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FileComponent Camel 2.2

Posted by Nick Mitchell <ni...@hmv.co.uk>.
So I tried that endpoint change again, I tried this already but no different. 

I finally got trace coming through and I did take a look at the source code
and for some reason it's using this as an absolute path instead of a
relative path. Is there any sort of override for that?

2010-04-07 09:19:39,742 [: FileComponent] DEBUG GenericFileOnCompletion       
- Done processing file:
GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
using exchange: Exchange[GenericFileMessage with body:
/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
2010-04-07 09:19:39,743 [: FileComponent] TRACE GenericFileOnCompletion       
- Commit file strategy:
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@3d428308
for file:
GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
2010-04-07 09:19:39,743 [: FileComponent] TRACE
rFileExclusiveReadLockStrategy - Unlocking file:
/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml.camelLock
2010-04-07 09:19:39,743 [: FileComponent] DEBUG FileUtil                      
- Tried 1 to delete file:
/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml.camelLock
with result: true
2010-04-07 09:19:39,743 [: FileComponent] TRACE
rFileExclusiveReadLockStrategy - Lock file:
/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml.camelLock
was deleted: true
2010-04-07 09:19:39,743 [: FileComponent] TRACE DefaultTypeConverter          
- Converting null -> java.lang.String with value: null
2010-04-07 09:19:39,743 [: FileComponent] TRACE DefaultTypeConverter          
- Converting java.lang.String -> java.lang.String with value: /.camel/
2010-04-07 09:19:39,743 [: FileComponent] TRACE DefaultTypeConverter          
- Converting null -> java.lang.String with value: null
2010-04-07 09:19:39,743 [: FileComponent] TRACE DefaultTypeConverter          
- Converting java.lang.String -> java.lang.String with value: /.camel/
2010-04-07 09:19:39,743 [: FileComponent] TRACE GenericFile                   
- Changing name to: /.camel/
2010-04-07 09:19:39,743 [: FileComponent] TRACE GenericFile                   
- Normalized endpointPath: /opt/feeds/ebook/in
2010-04-07 09:19:39,743 [: FileComponent] TRACE GenericFile                   
- Normalized newFileName: /.camel/
2010-04-07 09:19:39,743 [: FileComponent] TRACE GenericFile                   
- FileNameOnly: .camel
2010-04-07 09:19:39,743 [: FileComponent] TRACE GenericFile                   
- FileName: .camel
2010-04-07 09:19:39,743 [: FileComponent] TRACE GenericFile                   
- Absolute: true
2010-04-07 09:19:39,743 [: FileComponent] TRACE GenericFile                   
- Relative path: //.camel
2010-04-07 09:19:39,743 [: FileComponent] TRACE GenericFile                   
- Absolute path: /.camel/
2010-04-07 09:19:39,743 [: FileComponent] TRACE GenericFile                   
- Name changed to: GenericFile[/.camel/]
2010-04-07 09:19:39,744 [: FileComponent] DEBUG
nericFileRenameProcessStrategy - Renaming file:
GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
to: GenericFile[/.camel/]
2010-04-07 09:19:39,744 [: FileComponent] DEBUG FileUtil                      
- Retrying attempt 1 to rename file from:
/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml to:
/.camel
...
2010-04-07 09:19:41,748 [: FileComponent] DEBUG FileUtil                      
- Tried 3 to rename file:
/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml to:
/.camel with result: false
2010-04-07 09:19:41,759 [: FileComponent] ERROR GenericFileOnCompletion       
- Caused by:
[org.apache.camel.component.file.GenericFileOperationFailedException -
Cannot rename file:
GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
to: GenericFile[/.camel/]]
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
rename file:
GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
to: GenericFile[/.camel/]
	at
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
	at
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:72)
	at
org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:122)
	at
org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:83)
	at
org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:52)
	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:145)
	at
org.apache.camel.processor.UnitOfWorkProcessor.done(UnitOfWorkProcessor.java:82)
	at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:71)
	at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)
	at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:258)
	at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:137)
	at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:103)
	at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:106)
	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:181)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
	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:619)




-- 
View this message in context: http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28162033.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FileComponent Camel 2.2

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

On Tue, Apr 6, 2010 at 7:58 PM, Nick Mitchell <ni...@hmv.co.uk> wrote:
>
> Thanks for getting back to me.
>
> The file endpoint is
> file:/opt/feeds/ebook/in?sortBy=file:name&include=.*\.xml
> The OS is CentOS release 5.4 (Final)
>

Can you try to use this uri
 file:/opt/feeds/ebook/in?sortBy=file:name&include=.*\.xml&move=.camel

eg to set the move to .camel to force Camel to "re-evaluate" it.



> I have changed the log level and this is what it gave me.
>

The logger only output DEBUG level? Did you set it to TRACE?


> 2010-04-06 18:56:15,074 [: FileComponent] DEBUG FileConsumer
> - About to process file:
> GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
> using exchange: Exchange[GenericFileMessage with file:
> GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]]
> ...
> ...
> ...
> 2010-04-06 18:52:17,116 [: FileComponent] DEBUG GenericFileOnCompletion
> - Done processing file:
> GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
> using exchange: Exchange[GenericFileMessage with body:
> /opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
> 2010-04-06 18:52:17,121 [: FileComponent] DEBUG FileUtil
> - Tried 1 to delete file:
> /opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml.camelLock
> with result: true
> 2010-04-06 18:52:17,122 [: FileComponent] DEBUG
> nericFileRenameProcessStrategy - Renaming file:
> GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
> to: GenericFile[/.camel/]
> 2010-04-06 18:52:17,122 [: FileComponent] DEBUG FileUtil
> - Retrying attempt 1 to rename file from:
> /opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml to:
> /.camel
> 2010-04-06 18:52:18,123 [: FileComponent] DEBUG FileUtil
> - Retrying attempt 2 to rename file from:
> /opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml to:
> /.camel
> 2010-04-06 18:52:19,126 [: FileComponent] DEBUG FileUtil
> - Tried 3 to rename file:
> /opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml to:
> /.camel with result: false
> 2010-04-06 18:52:19,126 [: FileComponent] ERROR GenericFileOnCompletion
> - Caused by:
> [org.apache.camel.component.file.GenericFileOperationFailedException -
> Cannot rename file:
> GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
> to: GenericFile[/.camel/]]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> rename file:
> GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
> to: GenericFile[/.camel/]
>        at
> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
>        at
> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:72)
>        at
> org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:122)
>        at
> org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:83)
>        at
> org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:52)
>        at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:145)
>        at
> org.apache.camel.processor.UnitOfWorkProcessor.done(UnitOfWorkProcessor.java:82)
>        at
> org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:71)
>        at
> org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
>        at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)
>        at
> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:258)
>        at
> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:137)
>        at
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:103)
>        at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:106)
>        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:181)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
>        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:619)
>
>
>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> Can you enable TRACE logging for the following name:
>>
>> org.apache.camel.component.file.GenericFile
>>
>> It should log how it computes the renamed filename.
>>
>> Also post how you have configured the FILE endpoint.
>> And what OS are you using?
>>
>>
>>
>> On Tue, Apr 6, 2010 at 6:55 PM, Nick Mitchell <ni...@hmv.co.uk>
>> wrote:
>>>
>>> Hi,
>>>
>>> Apologies I posted this on the camel development forum too, but then
>>> realised that might be the wrong place.
>>>
>>> We've been using the file component for a while with camel version 2.0,
>>> and
>>> it has successfully moved files into a sub directory called .camel once
>>> they
>>> have been processed. We are in the process of trying to upgrade to
>>> version
>>> 2.2 but are experiencing some issues. The problem we are finding is that
>>> the
>>> file component is now looking for the .camel directory in the server root
>>> i.e. as an absolute path instead of a relative path. Obviously the
>>> directory
>>> does not exist and it is throwing an exception, see below. Any help would
>>> be
>>> appreciated.
>>>
>>>  [: FileComponent] ERROR GenericFileOnCompletion        - Caused by:
>>> [org.apache.camel.component.file.GenericFileOperationFailedException -
>>> Cannot rename file: GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL UNDER
>>> NDA
>>> SampleCrMetadata-20091216.xml] to: GenericFile[/.camel/]]
>>> org.apache.camel.component.file.GenericFileOperationFailedException:
>>> Cannot
>>> rename file: GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL UNDER NDA
>>> SampleCrMetadata-20091216.xml] to: GenericFile[/.camel/]
>>>        at
>>> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
>>>        at
>>> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:72)
>>>        at
>>> org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:122)
>>>        at
>>> org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:83)
>>>        at
>>> org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:52)
>>>        at
>>> org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:145)
>>>        at
>>> org.apache.camel.processor.UnitOfWorkProcessor.done(UnitOfWorkProcessor.java:82)
>>>        at
>>> org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:71)
>>>        at
>>> org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
>>>        at
>>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)
>>>        at
>>> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:258)
>>>        at
>>> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:137)
>>>        at
>>> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:103)
>>>        at
>>> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:106)
>>>        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:181)
>>>        at
>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
>>>        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:619)
>>>
>>> Thanks
>>> Nick
>>> --
>>> View this message in context:
>>> http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28154602.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28155375.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: FileComponent Camel 2.2

Posted by Nick Mitchell <ni...@hmv.co.uk>.
Thanks for getting back to me.

The file endpoint is
file:/opt/feeds/ebook/in?sortBy=file:name&include=.*\.xml
The OS is CentOS release 5.4 (Final)

I have changed the log level and this is what it gave me.

2010-04-06 18:56:15,074 [: FileComponent] DEBUG FileConsumer                  
- About to process file:
GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
using exchange: Exchange[GenericFileMessage with file:
GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]]
...
...
...
2010-04-06 18:52:17,116 [: FileComponent] DEBUG GenericFileOnCompletion       
- Done processing file:
GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
using exchange: Exchange[GenericFileMessage with body:
/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
2010-04-06 18:52:17,121 [: FileComponent] DEBUG FileUtil                      
- Tried 1 to delete file:
/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml.camelLock
with result: true
2010-04-06 18:52:17,122 [: FileComponent] DEBUG
nericFileRenameProcessStrategy - Renaming file:
GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
to: GenericFile[/.camel/]
2010-04-06 18:52:17,122 [: FileComponent] DEBUG FileUtil                      
- Retrying attempt 1 to rename file from:
/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml to:
/.camel
2010-04-06 18:52:18,123 [: FileComponent] DEBUG FileUtil                      
- Retrying attempt 2 to rename file from:
/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml to:
/.camel
2010-04-06 18:52:19,126 [: FileComponent] DEBUG FileUtil                      
- Tried 3 to rename file:
/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml to:
/.camel with result: false
2010-04-06 18:52:19,126 [: FileComponent] ERROR GenericFileOnCompletion       
- Caused by:
[org.apache.camel.component.file.GenericFileOperationFailedException -
Cannot rename file:
GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
to: GenericFile[/.camel/]]
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
rename file:
GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL_UNDER_NDA_SampleCrMetadata-20091216.xml]
to: GenericFile[/.camel/]
	at
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
	at
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:72)
	at
org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:122)
	at
org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:83)
	at
org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:52)
	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:145)
	at
org.apache.camel.processor.UnitOfWorkProcessor.done(UnitOfWorkProcessor.java:82)
	at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:71)
	at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)
	at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:258)
	at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:137)
	at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:103)
	at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:106)
	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:181)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
	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:619)




Claus Ibsen-2 wrote:
> 
> Hi
> 
> Can you enable TRACE logging for the following name:
> 
> org.apache.camel.component.file.GenericFile
> 
> It should log how it computes the renamed filename.
> 
> Also post how you have configured the FILE endpoint.
> And what OS are you using?
> 
> 
> 
> On Tue, Apr 6, 2010 at 6:55 PM, Nick Mitchell <ni...@hmv.co.uk>
> wrote:
>>
>> Hi,
>>
>> Apologies I posted this on the camel development forum too, but then
>> realised that might be the wrong place.
>>
>> We've been using the file component for a while with camel version 2.0,
>> and
>> it has successfully moved files into a sub directory called .camel once
>> they
>> have been processed. We are in the process of trying to upgrade to
>> version
>> 2.2 but are experiencing some issues. The problem we are finding is that
>> the
>> file component is now looking for the .camel directory in the server root
>> i.e. as an absolute path instead of a relative path. Obviously the
>> directory
>> does not exist and it is throwing an exception, see below. Any help would
>> be
>> appreciated.
>>
>>  [: FileComponent] ERROR GenericFileOnCompletion        - Caused by:
>> [org.apache.camel.component.file.GenericFileOperationFailedException -
>> Cannot rename file: GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL UNDER
>> NDA
>> SampleCrMetadata-20091216.xml] to: GenericFile[/.camel/]]
>> org.apache.camel.component.file.GenericFileOperationFailedException:
>> Cannot
>> rename file: GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL UNDER NDA
>> SampleCrMetadata-20091216.xml] to: GenericFile[/.camel/]
>>        at
>> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
>>        at
>> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:72)
>>        at
>> org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:122)
>>        at
>> org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:83)
>>        at
>> org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:52)
>>        at
>> org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:145)
>>        at
>> org.apache.camel.processor.UnitOfWorkProcessor.done(UnitOfWorkProcessor.java:82)
>>        at
>> org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:71)
>>        at
>> org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
>>        at
>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)
>>        at
>> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:258)
>>        at
>> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:137)
>>        at
>> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:103)
>>        at
>> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:106)
>>        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:181)
>>        at
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
>>        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:619)
>>
>> Thanks
>> Nick
>> --
>> View this message in context:
>> http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28154602.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28155375.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FileComponent Camel 2.2

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Can you enable TRACE logging for the following name:

org.apache.camel.component.file.GenericFile

It should log how it computes the renamed filename.

Also post how you have configured the FILE endpoint.
And what OS are you using?



On Tue, Apr 6, 2010 at 6:55 PM, Nick Mitchell <ni...@hmv.co.uk> wrote:
>
> Hi,
>
> Apologies I posted this on the camel development forum too, but then
> realised that might be the wrong place.
>
> We've been using the file component for a while with camel version 2.0, and
> it has successfully moved files into a sub directory called .camel once they
> have been processed. We are in the process of trying to upgrade to version
> 2.2 but are experiencing some issues. The problem we are finding is that the
> file component is now looking for the .camel directory in the server root
> i.e. as an absolute path instead of a relative path. Obviously the directory
> does not exist and it is throwing an exception, see below. Any help would be
> appreciated.
>
>  [: FileComponent] ERROR GenericFileOnCompletion        - Caused by:
> [org.apache.camel.component.file.GenericFileOperationFailedException -
> Cannot rename file: GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL UNDER NDA
> SampleCrMetadata-20091216.xml] to: GenericFile[/.camel/]]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> rename file: GenericFile[/opt/feeds/ebook/in/CONFIDENTIAL UNDER NDA
> SampleCrMetadata-20091216.xml] to: GenericFile[/.camel/]
>        at
> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:96)
>        at
> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:72)
>        at
> org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:122)
>        at
> org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:83)
>        at
> org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:52)
>        at
> org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:145)
>        at
> org.apache.camel.processor.UnitOfWorkProcessor.done(UnitOfWorkProcessor.java:82)
>        at
> org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:71)
>        at
> org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
>        at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)
>        at
> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:258)
>        at
> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:137)
>        at
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:103)
>        at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:106)
>        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:181)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
>        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:619)
>
> Thanks
> Nick
> --
> View this message in context: http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28154602.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus