camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlo Camerino <car...@sxchange.com.ph>
Subject Re: File Component Changes In Camel 2.0-M2
Date Thu, 16 Jul 2009 14:55:53 GMT
i tried the last one that you send.

here is  my example route

my goal is to be able to delete the file right after the route.
it doesn't delete it regardless of anything. it just keeps on throwing
errors and throwing errors.

the file should have been deleted already since I pointed it to a deadletter
channel right?
but the  consumer still consumes the same file.

My use case is that the file should already be gone right after an exception
occurs in the processor. but the file doesn't go away from the directory.

anything I should do?

**** THIS ONE HAS DEAD LETTER CHANNEL *****
package com.ccti.routes;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;

public class FileRouteBuilder extends RouteBuilder {

    @Override
    public void configure() throws Exception {
        // TODO Auto-generated method stub

    from("file://c:/upload/?delete=true").process(new Processor() {

        @Override
        public void process(Exchange arg0) throws Exception {
            // TODO Auto-generated method stub
            System.out.println("HELLO WORLD");
            throw new NullPointerException();
        }

        }).errorHandler(deadLetterChannel("log:error"));
    }
}


ELLO WORLD
Jul 16, 2009 10:52:51 PM org.apache.camel.processor.Logger log
SEVERE: Failed delivery for exchangeId: ID-wala-pc-14549-1247755970201-0-0.
On delivery attempt: 0 caught: java.lang.NullPointerException
java.lang.NullPointerException
    at com.ccti.routes.FileRouteBuilder$1.process(FileRouteBuilder.java:19)
    at
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.processor.DeadLetterChannel.processErrorHandler(DeadLetterChannel.java:172)
    at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:110)
    at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:147)
    at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
    at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
    at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:196)
    at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:122)
    at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:95)
    at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:79)
    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)
HELLO WORLD
Jul 16, 2009 10:52:52 PM org.apache.camel.processor.Logger log
SEVERE: Failed delivery for exchangeId: ID-wala-pc-14549-1247755970201-0-0.
On delivery attempt: 1 caught: java.lang.NullPointerException
java.lang.NullPointerException
    at com.ccti.routes.FileRouteBuilder$1.process(FileRouteBuilder.java:19)
    at
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.processor.DeadLetterChannel.processErrorHandler(DeadLetterChannel.java:172)
    at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:110)
    at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:147)
    at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
    at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
    at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:196)
    at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:122)
    at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:95)
    at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:79)
    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)
HELLO WORLD
Jul 16, 2009 10:52:53 PM org.apache.camel.processor.Logger log
SEVERE: Failed delivery for exchangeId: ID-wala-pc-14549-1247755970201-0-0.
On delivery attempt: 2 caught: java.lang.NullPointerException
java.lang.NullPointerException
    at com.ccti.routes.FileRouteBuilder$1.process(FileRouteBuilder.java:19)
    at
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.processor.DeadLetterChannel.processErrorHandler(DeadLetterChannel.java:172)
    at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:110)
    at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:147)
    at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
    at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
    at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:196)
    at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:122)
    at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:95)
    at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:79)
    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)

[...]

***** ROUTE WITHOUT ANY ERRORHANDLER ******

package com.ccti.routes;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;

public class FileRouteBuilder extends RouteBuilder {

    @Override
    public void configure() throws Exception {
        // TODO Auto-generated method stub

    from("file://c:/upload/?delete=true").process(new Processor() {

        @Override
        public void process(Exchange arg0) throws Exception {
            // TODO Auto-generated method stub
            System.out.println("HELLO WORLD");
            throw new NullPointerException();
        }

        });
    }
}

Jul 16, 2009 10:51:14 PM
org.springframework.context.support.AbstractApplicationContext
prepareRefresh
INFO: Refreshing
org.springframework.context.support.ClassPathXmlApplicationContext@f0c0d3:
display name
[org.springframework.context.support.ClassPathXmlApplicationContext@f0c0d3];
startup date [Thu Jul 16 22:51:14 CST 2009]; root of context hierarchy
Jul 16, 2009 10:51:14 PM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [camel-test.xml]
Jul 16, 2009 10:51:14 PM
org.springframework.context.support.AbstractApplicationContext
obtainFreshBeanFactory
INFO: Bean factory for application context
[org.springframework.context.support.ClassPathXmlApplicationContext@f0c0d3]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@162f030
Jul 16, 2009 10:51:14 PM org.apache.camel.impl.DefaultCamelContext <init>
INFO: JMX enabled. Using InstrumentationLifecycleStrategy.
Jul 16, 2009 10:51:14 PM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@162f030:
defining beans
[camelContext:beanPostProcessor,camelContext,fileRouteBuilder]; root of
factory hierarchy
Jul 16, 2009 10:51:14 PM org.apache.camel.impl.DefaultCamelContext doStart
INFO: Apache Camel 2.0-M2 (CamelContext:camelContext) is starting
Jul 16, 2009 10:51:15 PM org.apache.camel.impl.DefaultCamelContext start
INFO: Apache Camel 2.0-M2 (CamelContext:camelContext) started
HELLO WORLD
Jul 16, 2009 10:51:16 PM org.apache.camel.processor.Logger log
SEVERE: null
java.lang.NullPointerException
    at com.ccti.routes.FileRouteBuilder$1.process(FileRouteBuilder.java:19)
    at
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:52)
    at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:147)
    at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
    at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
    at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:196)
    at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:122)
    at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:95)
    at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:79)
    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)
Jul 16, 2009 10:51:16 PM
org.apache.camel.component.file.GenericFileOnCompletion
processStrategyRollback
WARNING: Rolling back remote file strategy:
org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@90d4f2for
file: GenericFile[c:\upload\Router Configuration.txt]
HELLO WORLD
Jul 16, 2009 10:51:16 PM org.apache.camel.processor.Logger log
SEVERE: null
java.lang.NullPointerException
    at com.ccti.routes.FileRouteBuilder$1.process(FileRouteBuilder.java:19)
    at
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:52)
    at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:147)
    at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
    at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
    at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:196)
    at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:122)
    at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:95)
    at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:79)
    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)
Jul 16, 2009 10:51:16 PM
org.apache.camel.component.file.GenericFileOnCompletion
processStrategyRollback
WARNING: Rolling back remote file strategy:
org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@90d4f2for
file: GenericFile[c:\upload\Router Configuration.txt]
HELLO WORLD
Jul 16, 2009 10:51:17 PM org.apache.camel.processor.Logger log
SEVERE: null
java.lang.NullPointerException
    at com.ccti.routes.FileRouteBuilder$1.process(FileRouteBuilder.java:19)
    at
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:52)
    at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:147)
    at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
    at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
    at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:196)
    at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:122)
    at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:95)
    at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:79)
    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)
Jul 16, 2009 10:51:17 PM
org.apache.camel.component.file.GenericFileOnCompletion
processStrategyRollback
WARNING: Rolling back remote file strategy:
org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@90d4f2for
file: GenericFile[c:\upload\Router Configuration.txt]
HELLO WORLD
Jul 16, 2009 10:51:17 PM org.apache.camel.processor.Logger log
SEVERE: null
java.lang.NullPointerException
    at com.ccti.routes.FileRouteBuilder$1.process(FileRouteBuilder.java:19)
    at
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:52)
    at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:147)
    at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
    at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
    at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:196)
    at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:122)
    at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:95)
    at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:79)
    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)
Jul 16, 2009 10:51:17 PM
org.apache.camel.component.file.GenericFileOnCompletion
processStrategyRollback
WARNING: Rolling back remote file strategy:
org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@90d4f2for
file: GenericFile[c:\upload\Router Configuration.txt]
HELLO WORLD
Jul 16, 2009 10:51:18 PM org.apache.camel.processor.Logger log
SEVERE: null
java.lang.NullPointerException
    at com.ccti.routes.FileRouteBuilder$1.process(FileRouteBuilder.java:19)
    at
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:52)
    at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:147)
    at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
    at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
    at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:196)
    at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:122)
    at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:95)
    at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:79)
    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)
Jul 16, 2009 10:51:18 PM
org.apache.camel.component.file.GenericFileOnCompletion
processStrategyRollback
WARNING: Rolling back remote file strategy:
org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@90d4f2for
file: GenericFile[c:\upload\Router Configuration.txt]
HELLO WORLD
Jul 16, 2009 10:51:18 PM org.apache.camel.processor.Logger log
SEVERE: null
java.lang.NullPointerException
    at com.ccti.routes.FileRouteBuilder$1.process(FileRouteBuilder.java:19)
    at
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:52)
    at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:147)
    at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
    at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
    at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:196)
    at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:122)
    at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:95)
    at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:79)
    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)
Jul 16, 2009 10:51:18 PM
org.apache.camel.component.file.GenericFileOnCompletion
processStrategyRollback
WARNING: Rolling back remote file strategy:
org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@90d4f2for
file: GenericFile[c:\upload\Router Configuration.txt]
HELLO WORLD
Jul 16, 2009 10:51:19 PM org.apache.camel.processor.Logger log
SEVERE: null
java.lang.NullPointerException
    at com.ccti.routes.FileRouteBuilder$1.process(FileRouteBuilder.java:19)
    at
org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
    at
org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:52)
    at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:147)
    at
org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
    at
org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
    at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:196)
    at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:122)
    at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:95)
    at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:79)
    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)
Jul 16, 2009 10:51:19 PM
org.apache.camel.component.file.GenericFileOnCompletion
processStrategyRollback
WARNING: Rolling back remote file strategy:
org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@90d4f2for
file: GenericFile[c:\upload\Router Configuration.txt]

[...]

On Thu, Jul 16, 2009 at 8:09 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:

> Hi
>
> BTW the reason for the behavior in 1.x vs. 2.0 is that in 1.x the
> error handler is Dead Letter Channel.
>
> See this link
> http://camel.apache.org/dead-letter-channel.html
>
> The dead letter channel will handle any exception and move the message
> to a dead letter channel.
> The default is to log it at ERROR level.
>
> So if you want this behavior in 2.0 then just switch to use the DLC as
> error handler
> Just add this to your java router
>
> errorHandler(deadLetterChannel("log:error"));
>
> If you want you can also use a file as destination so the files are
> moved to a invalid folder
>
> errorHandler(deadLetterChannel("file:c:/upt/invalid"));
>
>
> On Thu, Jul 16, 2009 at 10:56 AM, Claus Ibsen<claus.ibsen@gmail.com>
> wrote:
> > On Thu, Jul 16, 2009 at 10:48 AM, Carlo Camerino<carloc@sxchange.com.ph>
> wrote:
> >> is this different from route?
> >> my route is something like this
> >>
> >> from("file").to("direct").threads(5).process(new Processor()) {
> >> })
> >>
> >> before in camel 1.x, after leaving file, the file is already deleted.
> >> for now, will it only be deleted after processor?
> >
> > Yeah Camel uses onCompletion strategies to do the commit/rollback work
> > when the exchange has completed its route.
> > http://camel.apache.org/oncompletion.html
> >
> > So in this case the file component will do the delete of the file
> > after the exchange is done being routed.
> >
> > If you *always* want to delete the file then you can either one:
> > - use your own processStrategy on the file component that deletes the
> > file no matter what
> > - use your own onCompletion to delete the file no matter what
> > - use onException to handle the exception so Camel do not think there
> > is an exception
> >   for instance: onException(Exception.class).handled(true).stop()
> >
> > // ignore exception as we just handle them and stop continue routing.
> > Then the file component thinks we are finsihed
> > // and it will delete the file
> > onException(Exception.class).handled(true).stop();
> >
> > from(file).threads(5).process(new Processor());
> >
> >
> >
> >>
> >> thanks
> >> carlo
> >>
> >> On Thu, Jul 16, 2009 at 4:35 PM, Claus Ibsen <claus.ibsen@gmail.com>
> wrote:
> >>
> >>> Hi
> >>>
> >>> Yes Camel 2.0 is not 1.x. So some things are different/better in 2.0
> than
> >>> 1.x.
> >>> It was in fact wrong in 1.x where Camel just deletes/moves the file
> >>> regardless what happens.
> >>>
> >>> If you want the file deleted no matter what then move it to a seda
> >>> queue and grab it from there in the route you continue
> >>>
> >>> from(file) -> seda:foo
> >>> from(seda:foo) -> do whatever you want
> >>>
> >>> You can also provide your own process startegy to the camel file
> >>> component where you handle the commit/rollback yourself and delete the
> >>> file no matter what.
> >>>
> >>>
> >>>
> >>> On Thu, Jul 16, 2009 at 10:24 AM, Carlo Camerino<
> carloc@sxchange.com.ph>
> >>> wrote:
> >>> > what happens is taht the exceptions just ocntinue on appearing
> everytime.
> >>> > DEBUG - GenericFileOnCompletion    - Done processing file:
> >>> > GenericFile[c:\ufm\upload\UFM.png] using exchange:
> >>> > Exchange[GenericFileMessage with body:
> >>> > com.ccti.base.camel.model.FileModel@17d7379]
> >>> > ERROR - GenericFileOnCompletion    -
> >>> > java.lang.NullPointerException
> >>> >    at
> >>> >
> >>>
> com.ccti.carnelian.service.batchuploadhdr.BatchUploadHdrServiceImpl.updateRolledBackFile(BatchUploadHdrServiceImpl.java:103)
> >>> >    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>> >    at
> >>> >
> >>>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >>> >    at
> >>> >
> >>>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >>> >    at java.lang.reflect.Method.invoke(Method.java:585)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
> >>> >    at
> >>> >
> >>>
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> >>> >    at $Proxy25.updateRolledBackFile(Unknown Source)
> >>> >    at
> >>> >
> >>>
> com.ccti.carnelian.ufm.processor.PayoutFileProcessor.process(PayoutFileProcessor.java:58)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:52)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:147)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.ThreadsProcessor$1.call(ThreadsProcessor.java:94)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.ThreadsProcessor$1.call(ThreadsProcessor.java:92)
> >>> >    at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
> >>> >    at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> >>> >    at
> >>> >
> >>>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:65)
> >>> >    at
> >>> >
> >>>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:172)
> >>> >    at
> >>> >
> >>>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
> >>> >    at
> >>> >
> >>>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
> >>> >    at java.lang.Thread.run(Thread.java:595)
> >>> > WARN  - GenericFileOnCompletion    - Rolling back remote file
> strategy:
> >>> >
> >>>
> org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@1b5438dfor
> >>> > file: GenericFile[c:\ufm\upload\UFM.png]
> >>> > DEBUG - FileConsumer               - Total 1 files to consume
> >>> > DEBUG - FileConsumer               - About to process file:
> >>> > GenericFile[c:\ufm\upload\UFM.png] using exchange:
> >>> > Exchange[GenericFileMessage with file:
> >>> GenericFile[c:\ufm\upload\UFM.png]]
> >>> > Hibernate: select this_.ID as ID8_0_, this_.VERSION as VERSION8_0_,
> >>> this_.CD
> >>> > as CD8_0_, this_.DSCP as DSCP8_0_, this_.VALUE as VALUE8_0_,
> this_.TYPE
> >>> as
> >>> > TYPE8_0_, this_.IS_SECURITY as IS7_8_0_, this_.IS_EDITABLE as
> IS8_8_0_,
> >>> > this_.SEQ_NO as SEQ9_8_0_ from TBL_SYSPAR this_ where this_.CD=?
> >>> > Hibernate: select this_.ID as ID8_0_, this_.VERSION as VERSION8_0_,
> >>> this_.CD
> >>> > as CD8_0_, this_.DSCP as DSCP8_0_, this_.VALUE as VALUE8_0_,
> this_.TYPE
> >>> as
> >>> > TYPE8_0_, this_.IS_SECURITY as IS7_8_0_, this_.IS_EDITABLE as
> IS8_8_0_,
> >>> > this_.SEQ_NO as SEQ9_8_0_ from TBL_SYSPAR this_ where this_.CD=?
> >>> > Hibernate: select this_.CD_TYPE as CD1_7_0_, this_.VERSION as
> >>> VERSION7_0_,
> >>> > this_.CD_DSCP as CD3_7_0_, this_.IS_RESET as IS4_7_0_,
> this_.IS_CHK_DIGIT
> >>> as
> >>> > IS5_7_0_, this_.IS_W_CODE as IS6_7_0_, this_.IS_W_DATE as IS7_7_0_,
> >>> > this_.SEQ_LEN as SEQ8_7_0_, this_.IS_RESET_DAILY as IS9_7_0_ from
> >>> > TBL_SEQ_NO_TYPE this_ where this_.CD_TYPE=?
> >>> > Hibernate: select count(*) as y0_ from TBL_SEQ_NO_CD this_ where
> >>> this_.CD=?
> >>> > and this_.CD_TYPE=?
> >>> > Hibernate: select this_.ID as ID6_0_, this_.VERSION as VERSION6_0_,
> >>> this_.CD
> >>> > as CD6_0_, this_.CD_TYPE as CD4_6_0_, this_.SEQ_NO as SEQ5_6_0_,
> this_.DT
> >>> as
> >>> > DT6_0_ from TBL_SEQ_NO_CD this_ where this_.CD=? and this_.CD_TYPE=?
> >>> > Hibernate: update TBL_SEQ_NO_CD set VERSION=?, CD=?, CD_TYPE=?,
> SEQ_NO=?,
> >>> > DT=? where ID=? and VERSION=?
> >>> > Hibernate: select this_.ID as ID20_0_, this_.VERSION as VERSION20_0_,
> >>> > this_.REF_NO as REF3_20_0_, this_.UPLOAD_DT as UPLOAD4_20_0_,
> >>> this_.USER_CD
> >>> > as USER5_20_0_, this_.COMMUNITY_CD as COMMUNITY6_20_0_,
> this_.FILENAME as
> >>> > FILENAME20_0_, this_.NO_RECORDS as NO8_20_0_, this_.STATUS as
> >>> STATUS20_0_,
> >>> > this_.REASON as REASON20_0_, this_.PROC_DTTIME as PROC11_20_0_,
> >>> > this_.CENTER_CD as CENTER12_20_0_, this_.COVER_AMT as COVER13_20_0_,
> >>> > this_.COVER_NO as COVER14_20_0_, this_.XMIT_DT as XMIT15_20_0_,
> >>> > this_.OVERRIDE_USER as OVERRIDE16_20_0_, this_.NO_RECORDS_PROC as
> >>> > NO17_20_0_, this_.CNT_TOTAL as CNT18_20_0_, this_.TOTAL_AMT as
> >>> > TOTAL19_20_0_, this_.HASH_TOTAL as HASH20_20_0_ from
> TBL_BATCH_UPLOAD_HDR
> >>> > this_ where this_.REF_NO=?
> >>> > DEBUG - GenericFileOnCompletion    - Done processing file:
> >>> > GenericFile[c:\ufm\upload\UFM.png] using exchange:
> >>> > Exchange[GenericFileMessage with body:
> >>> > com.ccti.base.camel.model.FileModel@86a602]
> >>> > ERROR - GenericFileOnCompletion    -
> >>> > java.lang.NullPointerException
> >>> >    at
> >>> >
> >>>
> com.ccti.carnelian.service.batchuploadhdr.BatchUploadHdrServiceImpl.updateRolledBackFile(BatchUploadHdrServiceImpl.java:103)
> >>> >    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>> >    at
> >>> >
> >>>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >>> >    at
> >>> >
> >>>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >>> >    at java.lang.reflect.Method.invoke(Method.java:585)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
> >>> >    at
> >>> >
> >>>
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> >>> >    at $Proxy25.updateRolledBackFile(Unknown Source)
> >>> >    at
> >>> >
> >>>
> com.ccti.carnelian.ufm.processor.PayoutFileProcessor.process(PayoutFileProcessor.java:58)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:52)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:147)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.ThreadsProcessor$1.call(ThreadsProcessor.java:94)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.ThreadsProcessor$1.call(ThreadsProcessor.java:92)
> >>> >    at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
> >>> >    at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> >>> >    at
> >>> >
> >>>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:65)
> >>> >    at
> >>> >
> >>>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:172)
> >>> >    at
> >>> >
> >>>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
> >>> >    at
> >>> >
> >>>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
> >>> >    at java.lang.Thread.run(Thread.java:595)
> >>> > WARN  - GenericFileOnCompletion    - Rolling back remote file
> strategy:
> >>> >
> >>>
> org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@1b5438dfor
> >>> > file: GenericFile[c:\ufm\upload\UFM.png]
> >>> > DEBUG - FileConsumer               - Total 1 files to consume
> >>> > DEBUG - FileConsumer               - About to process file:
> >>> > GenericFile[c:\ufm\upload\UFM.png] using exchange:
> >>> > Exchange[GenericFileMessage with file:
> >>> GenericFile[c:\ufm\upload\UFM.png]]
> >>> > Hibernate: select this_.ID as ID8_0_, this_.VERSION as VERSION8_0_,
> >>> this_.CD
> >>> > as CD8_0_, this_.DSCP as DSCP8_0_, this_.VALUE as VALUE8_0_,
> this_.TYPE
> >>> as
> >>> > TYPE8_0_, this_.IS_SECURITY as IS7_8_0_, this_.IS_EDITABLE as
> IS8_8_0_,
> >>> > this_.SEQ_NO as SEQ9_8_0_ from TBL_SYSPAR this_ where this_.CD=?
> >>> > Hibernate: select this_.ID as ID8_0_, this_.VERSION as VERSION8_0_,
> >>> this_.CD
> >>> > as CD8_0_, this_.DSCP as DSCP8_0_, this_.VALUE as VALUE8_0_,
> this_.TYPE
> >>> as
> >>> > TYPE8_0_, this_.IS_SECURITY as IS7_8_0_, this_.IS_EDITABLE as
> IS8_8_0_,
> >>> > this_.SEQ_NO as SEQ9_8_0_ from TBL_SYSPAR this_ where this_.CD=?
> >>> > Hibernate: select this_.CD_TYPE as CD1_7_0_, this_.VERSION as
> >>> VERSION7_0_,
> >>> > this_.CD_DSCP as CD3_7_0_, this_.IS_RESET as IS4_7_0_,
> this_.IS_CHK_DIGIT
> >>> as
> >>> > IS5_7_0_, this_.IS_W_CODE as IS6_7_0_, this_.IS_W_DATE as IS7_7_0_,
> >>> > this_.SEQ_LEN as SEQ8_7_0_, this_.IS_RESET_DAILY as IS9_7_0_ from
> >>> > TBL_SEQ_NO_TYPE this_ where this_.CD_TYPE=?
> >>> > Hibernate: select count(*) as y0_ from TBL_SEQ_NO_CD this_ where
> >>> this_.CD=?
> >>> > and this_.CD_TYPE=?
> >>> > Hibernate: select this_.ID as ID6_0_, this_.VERSION as VERSION6_0_,
> >>> this_.CD
> >>> > as CD6_0_, this_.CD_TYPE as CD4_6_0_, this_.SEQ_NO as SEQ5_6_0_,
> this_.DT
> >>> as
> >>> > DT6_0_ from TBL_SEQ_NO_CD this_ where this_.CD=? and this_.CD_TYPE=?
> >>> > Hibernate: update TBL_SEQ_NO_CD set VERSION=?, CD=?, CD_TYPE=?,
> SEQ_NO=?,
> >>> > DT=? where ID=? and VERSION=?
> >>> > Hibernate: select this_.ID as ID20_0_, this_.VERSION as VERSION20_0_,
> >>> > this_.REF_NO as REF3_20_0_, this_.UPLOAD_DT as UPLOAD4_20_0_,
> >>> this_.USER_CD
> >>> > as USER5_20_0_, this_.COMMUNITY_CD as COMMUNITY6_20_0_,
> this_.FILENAME as
> >>> > FILENAME20_0_, this_.NO_RECORDS as NO8_20_0_, this_.STATUS as
> >>> STATUS20_0_,
> >>> > this_.REASON as REASON20_0_, this_.PROC_DTTIME as PROC11_20_0_,
> >>> > this_.CENTER_CD as CENTER12_20_0_, this_.COVER_AMT as COVER13_20_0_,
> >>> > this_.COVER_NO as COVER14_20_0_, this_.XMIT_DT as XMIT15_20_0_,
> >>> > this_.OVERRIDE_USER as OVERRIDE16_20_0_, this_.NO_RECORDS_PROC as
> >>> > NO17_20_0_, this_.CNT_TOTAL as CNT18_20_0_, this_.TOTAL_AMT as
> >>> > TOTAL19_20_0_, this_.HASH_TOTAL as HASH20_20_0_ from
> TBL_BATCH_UPLOAD_HDR
> >>> > this_ where this_.REF_NO=?
> >>> > DEBUG - GenericFileOnCompletion    - Done processing file:
> >>> > GenericFile[c:\ufm\upload\UFM.png] using exchange:
> >>> > Exchange[GenericFileMessage with body:
> >>> > com.ccti.base.camel.model.FileModel@1c59085]
> >>> > ERROR - GenericFileOnCompletion    -
> >>> > java.lang.NullPointerException
> >>> >    at
> >>> >
> >>>
> com.ccti.carnelian.service.batchuploadhdr.BatchUploadHdrServiceImpl.updateRolledBackFile(BatchUploadHdrServiceImpl.java:103)
> >>> >    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>> >    at
> >>> >
> >>>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >>> >    at
> >>> >
> >>>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >>> >    at java.lang.reflect.Method.invoke(Method.java:585)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
> >>> >    at
> >>> >
> >>>
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>> >    at
> >>> >
> >>>
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> >>> >    at $Proxy25.updateRolledBackFile(Unknown Source)
> >>> >    at
> >>> >
> >>>
> com.ccti.carnelian.ufm.processor.PayoutFileProcessor.process(PayoutFileProcessor.java:58)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:52)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:147)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.ThreadsProcessor$1.call(ThreadsProcessor.java:94)
> >>> >    at
> >>> >
> >>>
> org.apache.camel.processor.ThreadsProcessor$1.call(ThreadsProcessor.java:92)
> >>> >    at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
> >>> >    at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> >>> >    at
> >>> >
> >>>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:65)
> >>> >    at
> >>> >
> >>>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:172)
> >>> >    at
> >>> >
> >>>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
> >>> >    at
> >>> >
> >>>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
> >>> >    at java.lang.Thread.run(Thread.java:595)
> >>> > WARN  - GenericFileOnCompletion    - Rolling back remote file
> strategy:
> >>> >
> >>>
> org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@1b5438dfor
> >>> > file: GenericFile[c:\ufm\upload\UFM.png]
> >>> > DEBUG - FileConsumer               - Total 1 files to consume
> >>> > DEBUG - FileConsumer               - About to process file:
> >>> > GenericFile[c:\ufm\upload\UFM.png] using exchange: Excha
> >>> >
> >>> > [...]
> >>> >
> >>> >
> >>> > behavior wasn't like this before.
> >>> >
> >>> > On Thu, Jul 16, 2009 at 4:23 PM, Carlo Camerino <
> carloc@sxchange.com.ph
> >>> >wrote:
> >>> >
> >>> >> hmm, actually i'm already in a different route in where I process
> the
> >>> file
> >>> >> already.
> >>> >> what's happening is the file gets processed again. Before in
> previous
> >>> >> versions, I think the file is deleted right after the
> >>> >>
> >>> >> from("file:")
> >>> >>
> >>> >> declaration.
> >>> >>
> >>> >> is this a new behavior in camel 2?
> >>> >> i think this wasn't present before in the previous camel versions.
> >>> >>
> >>> >>
> >>> >> On Thu, Jul 16, 2009 at 4:20 PM, Claus Ibsen <claus.ibsen@gmail.com
> >>> >wrote:
> >>> >>
> >>> >>> On Thu, Jul 16, 2009 at 10:16 AM, Carlo Camerino<
> >>> carloc@sxchange.com.ph>
> >>> >>> wrote:
> >>> >>> > hi,
> >>> >>> >
> >>> >>> > i've also noticed this behavior change, when I encounter an error
> for
> >>> an
> >>> >>> > example ina  certgain part of the code and encounter an
> exception.
> >>> The
> >>> >>> file
> >>> >>> > still remains in the directory and the file will bde processed
> all
> >>> over
> >>> >>> > again.
> >>> >>> >
> >>> >>> > Does delete=true still work in this scenario?
> >>> >>> No Camel will only delete the file if it was processed OK.
> >>> >>>
> >>> >>> You do not want to "loose messages". If there is an error or the
> likes
> >>> >>> use Camel error handling to handle
> >>> >>> it in case you can and then the file can be deleted.
> >>> >>> http://camel.apache.org/error-handling-in-camel.html
> >>> >>>
> >>> >>>
> >>> >>>
> >>> >>> >
> >>> >>> > Thanks
> >>> >>> >
> >>> >>> > On Thu, Jul 16, 2009 at 3:59 PM, Carlo Camerino <
> >>> carloc@sxchange.com.ph
> >>> >>> >wrote:
> >>> >>> >
> >>> >>> >> i removed the annotations but still didn't work.
> >>> >>> >>
> >>> >>> >> it finally worked when I added a routebuilderref.
> >>> >>> >>
> >>> >>> >> thanks for the help!!!
> >>> >>> >>
> >>> >>> >>
> >>> >>> >> On Thu, Jul 16, 2009 at 3:52 PM, Claus Ibsen <
> claus.ibsen@gmail.com
> >>> >>> >wrote:
> >>> >>> >>
> >>> >>> >>> Hi
> >>> >>> >>>
> >>> >>> >>> If you are using some annotations in your route classes then
> Spring
> >>> >>> >>> might not be able to IoC them properly and just ignore these
> files.
> >>> >>> >>> Has been improved in later code, eg 2.0m3 or SNAPSHOT.
> >>> >>> >>>
> >>> >>> >>> So try not having annotations in them.
> >>> >>> >>>
> >>> >>> >>> And you can also use a <routeBuilderRef> to refer to the route
> >>> class
> >>> >>> >>> directly without the classpath scanner.
> >>> >>> >>>
> >>> >>> >>>
> >>> >>> >>> On Thu, Jul 16, 2009 at 9:49 AM, Carlo Camerino<
> >>> >>> carloc@sxchange.com.ph>
> >>> >>> >>> wrote:
> >>> >>> >>> > are my routes being picked up properly?
> >>> >>> >>> >
> >>> >>> >>> > here is the output of debug log in camel.
> >>> >>> >>> >
> >>> >>> >>> > INFO  - DefaultCamelContext        - JMX enabled. Using
> >>> >>> >>> > InstrumentationLifecycleStrategy.
> >>> >>> >>> > INFO  - CamelContextFactoryBean    - JMXAgent disabled
> >>> >>> >>> > DEBUG - CamelContextFactoryBean    - Found JAXB created
> routes:
> >>> []
> >>> >>> >>> > DEBUG - ltPackageScanClassResolver - Searching for
> >>> implementations
> >>> >>> of
> >>> >>> >>> > org.apache.camel.Routes in packages:
> >>> [com.ccti.carnelian.ufm.routes]
> >>> >>> >>> > DEBUG - ltPackageScanClassResolver - Loading from directory:
> >>> >>> >>> >
> >>> >>> >>>
> >>> >>>
> >>>
> C:\PROJECTS\CHINABANK\cbc-carnelian\carnelian-parent\carnelian-ufm\target\classes\com\ccti\carnelian\ufm\routes
> >>> >>> >>> > DEBUG - ltPackageScanClassResolver - Found: [class
> >>> >>> >>> > com.ccti.carnelian.ufm.routes.FileRouteBuilder, class
> >>> >>> >>> > com.ccti.carnelian.ufm.routes.QueueRouteBuilder]
> >>> >>> >>> > Hibernate: update TBL_USER set IS_LOGIN=0
> >>> >>> >>> > DEBUG - SpringCamelContext         - Publishing spring-event:
> >>> >>> >>> >
> >>> >>> >>>
> >>> >>>
> >>>
> org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.web.context.support.XmlWebApplicationContext@1b17d49
> >>> >>> >>> :
> >>> >>> >>> > display name [Root WebApplicationContext]; startup date [Thu
> Jul
> >>> 16
> >>> >>> >>> 15:46:19
> >>> >>> >>> > SGT 2009]; root of context hierarchy]
> >>> >>> >>> > DEBUG - SpringCamelContext         - Starting the
> CamelContext
> >>> now
> >>> >>> that
> >>> >>> >>> the
> >>> >>> >>> > ApplicationContext has started
> >>> >>> >>> > INFO  - DefaultCamelContext        - Apache Camel 2.0-M2
> >>> >>> >>> > (CamelContext:camelContext) is starting
> >>> >>> >>> > DEBUG - DefaultProducerServicePool - Starting service pool:
> >>> >>> >>> > org.apache.camel.impl.DefaultProducerServicePool@14c0761
> >>> >>> >>> > DEBUG - DefaultCamelContext        - StreamCaching is enabled
> >>> >>> >>> > DEBUG - DefaultComponent           - Creating endpoint
> >>> >>> >>> > uri=[spring-event:default], path=[default], parameters=[{}]
> >>> >>> >>> > DEBUG - DefaultCamelContext        - spring-event:default
> >>> converted
> >>> >>> to
> >>> >>> >>> > endpoint: Endpoint[spring-event:default] by component:
> >>> >>> >>> > org.apache.camel.component.event.EventComponent@1ca32f7
> >>> >>> >>> > DEBUG - DefaultProducerServicePool - Stopping service pool:
> >>> >>> >>> > org.apache.camel.impl.DefaultProducerServicePool@14c0761
> >>> >>> >>> > INFO  - DefaultCamelContext        - Apache Camel 2.0-M2
> >>> >>> >>> > (CamelContext:camelContext) started
> >>> >>> >>> >
> >>> >>> >>> > i'll paste trace log also
> >>> >>> >>> >
> >>> >>> >>> > On Thu, Jul 16, 2009 at 3:47 PM, Claus Ibsen <
> >>> claus.ibsen@gmail.com
> >>> >>> >
> >>> >>> >>> wrote:
> >>> >>> >>> >
> >>> >>> >>> >> Hi
> >>> >>> >>> >>
> >>> >>> >>> >> Is there any files to pickup? And Camel will also not read
> the
> >>> file
> >>> >>> if
> >>> >>> >>> >> it cannot get a read lock on the file.
> >>> >>> >>> >> Maybe the file is locked if you got it open in another
> program.
> >>> So
> >>> >>> >>> >> safe to drop in a file that you copy from somewhere else.
> >>> >>> >>> >>
> >>> >>> >>> >> And some user had trouble with MS Office files being locked
> on
> >>> >>> Windows.
> >>> >>> >>> >>
> >>> >>> >>> >> You can also skip this locking by setting readLock=none
> >>> >>> >>> >>
> >>> >>> >>> >> And enable TRACE logging at org.apache.camel.component.file
> to
> >>> see
> >>> >>> what
> >>> >>> >>> it
> >>> >>> >>> >> says.
> >>> >>> >>> >>
> >>> >>> >>> >>
> >>> >>> >>> >>
> >>> >>> >>> >> On Thu, Jul 16, 2009 at 9:32 AM, Carlo Camerino<
> >>> >>> carloc@sxchange.com.ph
> >>> >>> >>> >
> >>> >>> >>> >> wrote:
> >>> >>> >>> >> > hmm there's no camel locks in there.
> >>> >>> >>> >> > i deleted the directoyr, recreated it still doesn't work.
> >>> >>> >>> >> >
> >>> >>> >>> >> > here's my files
> >>> >>> >>> >> >
> >>> >>> >>> >> > package com.ccti.carnelian.ufm.routes;
> >>> >>> >>> >> >
> >>> >>> >>> >> > import java.io.File;
> >>> >>> >>> >> >
> >>> >>> >>> >> > import org.apache.camel.Exchange;
> >>> >>> >>> >> > import org.apache.camel.Processor;
> >>> >>> >>> >> > import org.apache.camel.builder.RouteBuilder;
> >>> >>> >>> >> > import org.apache.camel.impl.DefaultMessage;
> >>> >>> >>> >> > import org.apache.commons.io.FileUtils;
> >>> >>> >>> >> > import org.slf4j.Logger;
> >>> >>> >>> >> > import org.slf4j.LoggerFactory;
> >>> >>> >>> >> >
> >>> >>> >>> >> > import com.ccti.base.camel.model.FileModel;
> >>> >>> >>> >> > import com.ccti.base.camel.processors.FileWaitProcessor;
> >>> >>> >>> >> > import com.ccti.base.dao.syspar.SysParDao;
> >>> >>> >>> >> >
> >>> >>> >>> >> > public class FileRouteBuilder extends RouteBuilder {
> >>> >>> >>> >> >    private static final Logger logger =
> >>> >>> >>> >> > LoggerFactory.getLogger(FileRouteBuilder.class);
> >>> >>> >>> >> >    private SysParDao sysParDao;
> >>> >>> >>> >> >
> >>> >>> >>> >> >    @Override
> >>> >>> >>> >> >    public void configure() throws Exception {
> >>> >>> >>> >> >            from("file:" + "c:/ufm/upload/" ).process(new
> >>> >>> >>> >> > FileWaitProcessor()).process(new Processor() {
> >>> >>> >>> >> >
> >>> >>> >>> >> >                public void process(Exchange exchange)
> throws
> >>> >>> >>> Exception {
> >>> >>> >>> >> >                    try {
> >>> >>> >>> >> >                        FileModel fileModel = new
> FileModel();
> >>> >>> >>> >> >                        logExchangeDetails(exchange);
> >>> >>> >>> >> >                        // kailangan ko ipa write ito sa
> isang
> >>> >>> >>> directory
> >>> >>> >>> >> >                        logger.debug("Making A copy Of File
> In
> >>> >>> >>> Processed
> >>> >>> >>> >> > Directory.");
> >>> >>> >>> >> >                        String processedDirectory =
> >>> >>> >>> >> > sysParDao.findValueByCd("USR082");
> >>> >>> >>> >> >                        String inputDirectory =
> >>> >>> >>> >> > sysParDao.findValueByCd("USR081");
> >>> >>> >>> >> >                        FileUtils.copyFile(new
> >>> File(inputDirectory
> >>> >>> +
> >>> >>> >>> >> > exchange.getIn().getHeader("org.apache.camel.file.name
> ")),
> >>> new
> >>> >>> >>> >> > File(processedDirectory + exchange.getIn().getHeader("
> >>> >>> >>> >> > org.apache.camel.file.name") + "-USED"));
> >>> >>> >>> >> >                        DefaultMessage defaultMessage = new
> >>> >>> >>> >> > DefaultMessage();
> >>> >>> >>> >> >
> >>>  fileModel.setFileName(processedDirectory +
> >>> >>> >>> >> > exchange.getIn().getHeader("org.apache.camel.file.name
> >>> >>> ").toString()
> >>> >>> >>> +
> >>> >>> >>> >> > "-USED");
> >>> >>> >>> >> >
> >>> >>> >>> >>  fileModel.setCoverName(exchange.getIn().getHeader("
> >>> >>> >>> >> > org.apache.camel.file.name").toString());
> >>> >>> >>> >> >                        defaultMessage.setBody(fileModel);
> >>> >>> >>> >> >                        exchange.setOut(defaultMessage);
> >>> >>> >>> >> >                        logger.debug("Successfuly Copied
> >>> File.");
> >>> >>> >>> >> >                    }
> >>> >>> >>> >> >                    catch (Exception e) {
> >>> >>> >>> >> >                        logger.error(e.getMessage());
> >>> >>> >>> >> >                        e.printStackTrace();
> >>> >>> >>> >> >                    }
> >>> >>> >>> >> >                }
> >>> >>> >>> >> >
> >>> >>> >>> >> >                private void logExchangeDetails(Exchange
> >>> exchange)
> >>> >>> {
> >>> >>> >>> >> >                    if(logger.isDebugEnabled()) {
> >>> >>> >>> >> >                        logger.debug(exchange.getIn() +
> "");
> >>> >>> >>> >> >
> >>> >>> >>> >>  logger.debug(exchange.getIn().getClass().getName());
> >>> >>> >>> >> >
> >>>  logger.debug(exchange.getIn().getHeader("
> >>> >>> >>> >> > org.apache.camel.file.name").toString());
> >>> >>> >>> >> >                        logger.debug(exchange.getOut() +
> "");
> >>> >>> >>> >> >                    }
> >>> >>> >>> >> >                }
> >>> >>> >>> >> >
> >>> >>> >>> >> >            }).to("direct:processingQueue");
> >>> >>> >>> >> >
> >>> >>> >>> >> >    }
> >>> >>> >>> >> >
> >>> >>> >>> >> >    public SysParDao getSysParDao() {
> >>> >>> >>> >> >        return sysParDao;
> >>> >>> >>> >> >    }
> >>> >>> >>> >> >
> >>> >>> >>> >> >    public void setSysParDao(SysParDao sysParDao) {
> >>> >>> >>> >> >        this.sysParDao = sysParDao;
> >>> >>> >>> >> >    }
> >>> >>> >>> >> > }
> >>> >>> >>> >> >
> >>> >>> >>> >> > <?xml version = "1.0" encoding = "UTF-8"?>
> >>> >>> >>> >> > <beans xmlns="http://www.springframework.org/schema/beans
> "
> >>> >>> >>> >> >    xmlns:amq="http://activemq.apache.org/schema/core"
> >>> >>> >>> >> >    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>> >>> >>> >> >    xmlns:jms="http://www.springframework.org/schema/jms"
> >>> >>> >>> >> >    xmlns:tx="http://www.springframework.org/schema/tx"
> >>> >>> >>> >> >    xmlns:camel="http://camel.apache.org/schema/spring"
> >>> >>> >>> >> >    xsi:schemaLocation="
> >>> >>> http://www.springframework.org/schema/beans
> >>> >>> >>> >> >
> >>> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
> >>> >>> >>> >> >  http://activemq.apache.org/schema/core
> >>> >>> >>> >> > http://activemq.apache.org/schema/core/activemq-core.xsd
> >>> >>> >>> >> >  http://www.springframework.org/schema/jms
> >>> >>> >>> >> >
> http://www.springframework.org/schema/jms/spring-jms-2.5.xsd
> >>> >>> >>> >> >  http://www.springframework.org/schema/tx
> >>> >>> >>> >> >
> http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
> >>> >>> >>> >> >  http://camel.apache.org/schema/spring
> >>> >>> >>> >> > http://camel.apache.org/schema/spring/camel-spring.xsd
> >>> >>> >>> >> >  ">
> >>> >>> >>> >> >
> >>> >>> >>> >> >    <camel:camelContext id="camelContext">
> >>> >>> >>> >> >
> >>> >>>  <camel:package>com.ccti.carnelian.ufm.routes</camel:package>
> >>> >>> >>> >> >        <camel:jmxAgent id = "agent" disabled="true"/>
> >>> >>> >>> >> >    </camel:camelContext>
> >>> >>> >>> >> >
> >>> >>> >>> >> > I will be insvesitigating also. maybe it's just a simple
> >>> mistake
> >>> >>> or
> >>> >>> >>> >> > something
> >>> >>> >>> >> >
> >>> >>> >>> >> > On Thu, Jul 16, 2009 at 2:33 PM, Claus Ibsen <
> >>> >>> claus.ibsen@gmail.com>
> >>> >>> >>> >> wrote:
> >>> >>> >>> >> >
> >>> >>> >>> >> >> On Thu, Jul 16, 2009 at 8:29 AM, Carlo Camerino<
> >>> >>> >>> carloc@sxchange.com.ph>
> >>> >>> >>> >> >> wrote:
> >>> >>> >>> >> >> > it doesn't even enter the filewaitprocessor
> >>> >>> >>> >> >>
> >>> >>> >>> >> >> Could you take a look into the c:/ufm/upload folder.
> There
> >>> could
> >>> >>> be
> >>> >>> >>> >> >> some .camelLock file lurking that blocks it.
> >>> >>> >>> >> >> eg you can try removing this folder all together and
> create a
> >>> >>> new
> >>> >>> >>> empty
> >>> >>> >>> >> >> one.
> >>> >>> >>> >> >>
> >>> >>> >>> >> >>
> >>> >>> >>> >> >>
> >>> >>> >>> >> >> >
> >>> >>> >>> >> >> > On Thu, Jul 16, 2009 at 2:26 PM, Carlo Camerino <
> >>> >>> >>> >> carloc@sxchange.com.ph
> >>> >>> >>> >> >> >wrote:
> >>> >>> >>> >> >> >
> >>> >>> >>> >> >> >> Hi,
> >>> >>> >>> >> >> >>
> >>> >>> >>> >> >> >> Here is my route.
> >>> >>> >>> >> >> >>
> >>> >>> >>> >> >> >> public void configure() throws Exception {
> >>> >>> >>> >> >> >>             from("file://" + "c:/ufm/upload/" +
> >>> >>> >>> >> >> "?delete=true").process(new
> >>> >>> >>> >> >> >> FileWaitProcessor()).process(new Processor() {
> >>> >>> >>> >> >> >>
> >>> >>> >>> >> >> >>                 public void process(Exchange exchange)
> >>> throws
> >>> >>> >>> >> Exception
> >>> >>> >>> >> >> {
> >>> >>> >>> >> >> >>                     try {
> >>> >>> >>> >> >> >>                         FileModel fileModel = new
> >>> >>> FileModel();
> >>> >>> >>> >> >> >>                         logExchangeDetails(exchange);
> >>> >>> >>> >> >> >>                         // kailangan ko ipa write ito
> sa
> >>> >>> isang
> >>> >>> >>> >> directory
> >>> >>> >>> >> >> >>                         logger.debug("Making A copy Of
> >>> File
> >>> >>> In
> >>> >>> >>> >> Processed
> >>> >>> >>> >> >> >> Directory.");
> >>> >>> >>> >> >> >>                         String processedDirectory =
> >>> >>> >>> >> >> >> sysParDao.findValueByCd("USR082");
> >>> >>> >>> >> >> >>                         String inputDirectory =
> >>> >>> >>> >> >> >> sysParDao.findValueByCd("USR081");
> >>> >>> >>> >> >> >>                         FileUtils.copyFile(new
> >>> >>> >>> File(inputDirectory +
> >>> >>> >>> >> >> >> exchange.getIn().getHeader("
> org.apache.camel.file.name
> >>> ")),
> >>> >>> new
> >>> >>> >>> >> >> >> File(processedDirectory + exchange.getIn().getHeader("
> >>> >>> >>> >> >> >> org.apache.camel.file.name") + "-USED"));
> >>> >>> >>> >> >> >>                         DefaultMessage defaultMessage
> =
> >>> new
> >>> >>> >>> >> >> >> DefaultMessage();
> >>> >>> >>> >> >> >>
> >>> >>> fileModel.setFileName(processedDirectory
> >>> >>> >>> +
> >>> >>> >>> >> >> >> exchange.getIn().getHeader("
> org.apache.camel.file.name
> >>> >>> >>> ").toString()
> >>> >>> >>> >> +
> >>> >>> >>> >> >> >> "-USED");
> >>> >>> >>> >> >> >>
> >>> >>> >>> >> >> fileModel.setCoverName(exchange.getIn().getHeader("
> >>> >>> >>> >> >> >> org.apache.camel.file.name").toString());
> >>> >>> >>> >> >> >>
> defaultMessage.setBody(fileModel);
> >>> >>> >>> >> >> >>
> exchange.setOut(defaultMessage);
> >>> >>> >>> >> >> >>                         logger.debug("Successfuly
> Copied
> >>> >>> File.");
> >>> >>> >>> >> >> >>                     }
> >>> >>> >>> >> >> >>                     catch (Exception e) {
> >>> >>> >>> >> >> >>                         logger.error(e.getMessage());
> >>> >>> >>> >> >> >>                         e.printStackTrace();
> >>> >>> >>> >> >> >>                     }
> >>> >>> >>> >> >> >>                 }
> >>> >>> >>> >> >> >>
> >>> >>> >>> >> >> >>                 private void
> logExchangeDetails(Exchange
> >>> >>> >>> exchange) {
> >>> >>> >>> >> >> >>                     if(logger.isDebugEnabled()) {
> >>> >>> >>> >> >> >>                         logger.debug(exchange.getIn()
> +
> >>> "");
> >>> >>> >>> >> >> >>
> >>> >>> >>> >> >> >> logger.debug(exchange.getIn().getClass().getName());
> >>> >>> >>> >> >> >>
> >>> >>> logger.debug(exchange.getIn().getHeader("
> >>> >>> >>> >> >> >> org.apache.camel.file.name").toString());
> >>> >>> >>> >> >> >>                         logger.debug(exchange.getOut()
> +
> >>> "");
> >>> >>> >>> >> >> >>                     }
> >>> >>> >>> >> >> >>                 }
> >>> >>> >>> >> >> >>
> >>> >>> >>> >> >> >>             }).to("direct:processingQueue");
> >>> >>> >>> >> >> >>
> >>> >>> >>> >> >> >> Thanks In Advance
> >>> >>> >>> >> >> >>
> >>> >>> >>> >> >> >>
> >>> >>> >>> >> >> >> On Thu, Jul 16, 2009 at 1:02 PM, Claus Ibsen <
> >>> >>> >>> claus.ibsen@gmail.com
> >>> >>> >>> >> >> >wrote:
> >>> >>> >>> >> >> >>
> >>> >>> >>> >> >> >>> Hi
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>> On Thu, Jul 16, 2009 at 6:29 AM, Carlo Camerino<
> >>> >>> >>> >> >> carlo.camerino@gmail.com>
> >>> >>> >>> >> >> >>> wrote:
> >>> >>> >>> >> >> >>> > hi,
> >>> >>> >>> >> >> >>> >
> >>> >>> >>> >> >> >>> > i'm currently using file component in camel 2.0-M2.
> I'm
> >>> >>> >>> finding
> >>> >>> >>> >> out
> >>> >>> >>> >> >> that
> >>> >>> >>> >> >> >>> > it's not working properly already unlike in camel
> 1.6
> >>> >>> below.
> >>> >>> >>> >> >> >>> > is there any changes that I need to be implemented?
> >>> >>> >>> >> >> >>> >
> >>> >>> >>> >> >> >>> > The same route that I used for Camel 1.5 is not
> working
> >>> >>> for
> >>> >>> >>> camel
> >>> >>> >>> >> >> 2.0-M2
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>> Camel 2 have a rewritten file component so some
> options
> >>> in
> >>> >>> 1.5
> >>> >>> >>> is eg
> >>> >>> >>> >> >> >>> not the same in 2.0.
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>> >
> >>> >>> >>> >> >> >>> > It's not getting properly from the directory that I
> set
> >>> it
> >>> >>> to
> >>> >>> >>> get
> >>> >>> >>> >> >> from.
> >>> >>> >>> >> >> >>> > Do I need to change anything?
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>> First you need to post what the problem is. Writing
> that
> >>> X
> >>> >>> does
> >>> >>> >>> not
> >>> >>> >>> >> >> >>> work is not gonna help to much without
> >>> >>> >>> >> >> >>> being more specific.
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>> And also posting your route will help.
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>> >
> >>> >>> >>> >> >> >>> > Should I use file2 instead?
> >>> >>> >>> >> >> >>> >
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>> No there is no file2 as such. Its just the camel
> >>> >>> documentation
> >>> >>> >>> being
> >>> >>> >>> >> >> >>> divided into the old and the new (file2).
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>> > Carlo
> >>> >>> >>> >> >> >>> >
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>> --
> >>> >>> >>> >> >> >>> Claus Ibsen
> >>> >>> >>> >> >> >>> Apache Camel Committer
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>> Open Source Integration: http://fusesource.com
> >>> >>> >>> >> >> >>> Blog: http://davsclaus.blogspot.com/
> >>> >>> >>> >> >> >>> Twitter: http://twitter.com/davsclaus
> >>> >>> >>> >> >> >>>
> >>> >>> >>> >> >> >>
> >>> >>> >>> >> >> >>
> >>> >>> >>> >> >> >
> >>> >>> >>> >> >>
> >>> >>> >>> >> >>
> >>> >>> >>> >> >>
> >>> >>> >>> >> >> --
> >>> >>> >>> >> >> Claus Ibsen
> >>> >>> >>> >> >> Apache Camel Committer
> >>> >>> >>> >> >>
> >>> >>> >>> >> >> Open Source Integration: http://fusesource.com
> >>> >>> >>> >> >> Blog: http://davsclaus.blogspot.com/
> >>> >>> >>> >> >> Twitter: http://twitter.com/davsclaus
> >>> >>> >>> >> >>
> >>> >>> >>> >> >
> >>> >>> >>> >>
> >>> >>> >>> >>
> >>> >>> >>> >>
> >>> >>> >>> >> --
> >>> >>> >>> >> Claus Ibsen
> >>> >>> >>> >> Apache Camel Committer
> >>> >>> >>> >>
> >>> >>> >>> >> Open Source Integration: http://fusesource.com
> >>> >>> >>> >> Blog: http://davsclaus.blogspot.com/
> >>> >>> >>> >> Twitter: http://twitter.com/davsclaus
> >>> >>> >>> >>
> >>> >>> >>> >
> >>> >>> >>>
> >>> >>> >>>
> >>> >>> >>>
> >>> >>> >>> --
> >>> >>> >>> Claus Ibsen
> >>> >>> >>> Apache Camel Committer
> >>> >>> >>>
> >>> >>> >>> Open Source Integration: http://fusesource.com
> >>> >>> >>> Blog: http://davsclaus.blogspot.com/
> >>> >>> >>> Twitter: http://twitter.com/davsclaus
> >>> >>> >>>
> >>> >>> >>
> >>> >>> >>
> >>> >>> >
> >>> >>>
> >>> >>>
> >>> >>>
> >>> >>> --
> >>> >>> Claus Ibsen
> >>> >>> Apache Camel Committer
> >>> >>>
> >>> >>> Open Source Integration: http://fusesource.com
> >>> >>> Blog: http://davsclaus.blogspot.com/
> >>> >>> Twitter: http://twitter.com/davsclaus
> >>> >>>
> >>> >>
> >>> >>
> >>> >
> >>>
> >>>
> >>>
> >>> --
> >>> Claus Ibsen
> >>> Apache Camel Committer
> >>>
> >>> Open Source Integration: http://fusesource.com
> >>> Blog: http://davsclaus.blogspot.com/
> >>> Twitter: http://twitter.com/davsclaus
> >>>
> >>
> >
> >
> >
> > --
> > Claus Ibsen
> > Apache Camel Committer
> >
> > Open Source Integration: http://fusesource.com
> > Blog: http://davsclaus.blogspot.com/
> > Twitter: http://twitter.com/davsclaus
> >
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message