Camel
  1. Camel
  2. CAMEL-5684

possible null pointer exception for FTP endpoint

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.10.1
    • Fix Version/s: 2.9.5, 2.10.3, 2.11.0
    • Component/s: camel-ftp
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      If for source endpoint you specify directory name without trailing slash and place there file, which name starts like the directory name, you'll get null pointer exception.

      ftp://[username@]hostname[:port]/directoryname[?options]

      For example:
      <endpoint id="ftpSource" uri="ftp://192.168.0.81:21/input?fileName= ...
      File with name "input" will give exception, file with name "bla" will be processed normally.

      This will work fine:
      <endpoint id="ftpSource" uri="ftp://192.168.0.81:21/input/?fileName= ...

      Part of stack trace:
      java.lang.NullPointerException
      ...
      org.apache.camel.impl.BridgeExceptionHandlerToErrorHandler.handleException(BridgeExceptionHandlerToErrorHandler.java:53)
      org.apache.camel.impl.DefaultConsumer.handleException(DefaultConsumer.java:112)
      org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:303)
      org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(RemoteFileConsumer.java:94)
      org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:189)
      org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:155)
      org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:139)
      ...

      Thanks.

        Activity

        Hide
        Claus Ibsen added a comment -

        Please next time post the full stacktrace, so we are sure where the NPE is being thrown.

        Show
        Claus Ibsen added a comment - Please next time post the full stacktrace, so we are sure where the NPE is being thrown.
        Hide
        KaterynaDanyliuk added a comment -

        OK, should I provide full stacktrace for this case? I will be able to do it tomorrow.
        Thank you!

        Show
        KaterynaDanyliuk added a comment - OK, should I provide full stacktrace for this case? I will be able to do it tomorrow. Thank you!
        Hide
        Claus Ibsen added a comment -

        And what OS are you using on the Camel side?

        Show
        Claus Ibsen added a comment - And what OS are you using on the Camel side?
        Hide
        Claus Ibsen added a comment -

        And what is the name of the remote file being picked up? Is it "input" or just starts with input and named "input.txt" etc?

        I cannot reproduce the issue on trunk code.

        Show
        Claus Ibsen added a comment - And what is the name of the remote file being picked up? Is it "input" or just starts with input and named "input.txt" etc? I cannot reproduce the issue on trunk code.
        Hide
        KaterynaDanyliuk added a comment - - edited

        We run Camel on Tomcat/Windows7.
        FTP is on Ubuntu.
        The name of remote file just has to start with the name of directory (so both "input" and "input.txt" gave NPE).

        Show
        KaterynaDanyliuk added a comment - - edited We run Camel on Tomcat/Windows7. FTP is on Ubuntu. The name of remote file just has to start with the name of directory (so both "input" and "input.txt" gave NPE).
        Hide
        Claus Ibsen added a comment -

        Can you post your ftp uri you use with all its options etc. And also a full stacktrace.
        I cannot reproduce the issue on either osx or windows.

        Show
        Claus Ibsen added a comment - Can you post your ftp uri you use with all its options etc. And also a full stacktrace. I cannot reproduce the issue on either osx or windows.
        Hide
        KaterynaDanyliuk added a comment -

        Sorry for delay.

        So endpoints:

        <endpoint id="ftpSource1" uri="ftp://192.168.0.81:21/input?pollStrategy=#ftpPollStrategy&throwExceptionOnConnectFailed=true&binary=false&passiveMode=false&readLock=rename&delete=true&include=.*&delay=5000&localWorkDirectory=.tmp&username=tyuha&password=mypass&maxMessagesPerPoll=100&consumer.bridgeErrorHandler=true" />

        <endpoint id="ftpTarget1" uri="ftp://192.168.0.81:21/output?fileName=$

        {file:name}

        &username=tyuha&password=mypass&binary=false&passiveMode=false&throwExceptionOnConnectFailed=true" />

        Route is quite simple:
        <route id="FTPCustRoute">
        <from ref="ftpSource1" />
        <to ref="ftpTarget1" />
        </route>

        Not to omit anything:

        51310 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO org.apache.camel.component.file.remote.RemoteFileProducer - Connected and logged in to: Endpointftp://192.168.0.81:21/output?binary=false&fileName=%24%7Bfile%3Aname%7D&passiveMode=false&password=******&throwExceptionOnConnectFailed=true&username=tyuha
        51326 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-2 >>> (FTPCustRoute) from(ftp://192.168.0.81:21/input?binary=false&consumer.bridgeErrorHandler=true&delay=5000&delete=true&include=.*&localWorkDirectory=.tmp&maxMessagesPerPoll=100&passiveMode=false&password=mypass&pollStrategy=%23ftpPollStrategy&readLock=rename&throwExceptionOnConnectFailed=true&username=tyuha) --> ftp://192.168.0.81:21/output?binary=false&fileName=%24%7Bfile%3Aname%7D&passiveMode=false&password=******&throwExceptionOnConnectFailed=true&username=tyuha <<< Pattern:InOnly, Headers:

        {CamelFileLastModified=Wed Oct 03 11:37:00 EEST 2012, CamelFileNameOnly=read.txt, CamelFileLength=22, CamelFileHost=192.168.0.81, CamelFileAbsolute=false, CamelFileParent=input, CamelFileNameProduced=output/read.txt, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-1, CamelFilePath=input/read.txt, CamelFileName=read.txt, CamelFileAbsolutePath=input/read.txt, CamelFileRelativePath=read.txt, CamelFileLocalWorkPath=.tmp\read.txt}

        , BodyType:org.apache.camel.component.file.remote.RemoteFile, Body:[Body is file based: GenericFile[read.txt]]
        56795 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-4 >>> () from(ftp://192.168.0.81:21/input?binary=false&consumer.bridgeErrorHandler=true&delay=5000&delete=true&include=.*&localWorkDirectory=.tmp&maxMessagesPerPoll=100&passiveMode=false&password=mypass&pollStrategy=%23ftpPollStrategy&readLock=rename&throwExceptionOnConnectFailed=true&username=tyuha) --> OnException[NullPointerException] <<< Pattern:InOnly, Headers:

        {CamelRedeliveryCounter=0, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-3, CamelRedelivered=false, CamelRedeliveryMaxCounter=1}, BodyType:String, Body:Endpointftp://192.168.0.81:21/input?binary=false&consumer.bridgeErrorHandler=true&delay=5000&delete=true&include=.*&localWorkDirectory=.tmp&maxMessagesPerPoll=100&passiveMode=false&password=******&pollStrategy=%23ftpPollStrategy&readLock=rename&throwExceptionOnConnectFailed=true&username=tyuha cannot begin processing file: GenericFile[inputFile] due to: null
        56895 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-4 >>> OnException[NullPointerException] --> <<< Pattern:InOnly, Headers:{CamelRedeliveryCounter=0, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-3, CamelRedelivered=false, CamelRedeliveryMaxCounter=1}

        , BodyType:String, Body:Endpointftp://192.168.0.81:21/input?binary=false&consumer.bridgeErrorHandler=true&delay=5000&delete=true&include=.*&localWorkDirectory=.tmp&maxMessagesPerPoll=100&passiveMode=false&password=******&pollStrategy=%23ftpPollStrategy&readLock=rename&throwExceptionOnConnectFailed=true&username=tyuha cannot begin processing file: GenericFile[inputFile] due to: null
        56945 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-4 >>> OnException[NullPointerException] --> <<< (OUT), Pattern:InOnly, Headers:

        {CamelRedeliveryCounter=0, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-3, CamelRedelivered=false, CamelRedeliveryMaxCounter=1}, BodyType:String, Body:Exception occured: java.lang.NullPointerException
        File name: null
        java.lang.NullPointerException
        com.it.ids.exceptions.HandleException.process(HandleException.java:20)
        org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
        org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
        org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcesso... [Body clipped after 1000 chars, total length is 5932]
        57075 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-4 >>> --> file://..%5C..%5C.exceptions%5C?fileName=%24%7Bdate%3Anow%3AyyyyMMdd%7D%5C%24%7Bfile%3Aname.noext%7D%24%7Bdate%3Anow%3AyyyyMMddHHmmssSSS%7D-errorOnException.%24%7Bfile%3Aext%7D <<< Pattern:InOnly, Headers:{CamelRedeliveryCounter=0, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-3, CamelRedelivered=false, CamelRedeliveryMaxCounter=1}

        , BodyType:String, Body:Exception occured: java.lang.NullPointerException
        File name: null
        java.lang.NullPointerException
        com.it.ids.exceptions.HandleException.process(HandleException.java:20)
        org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
        org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
        org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcesso... [Body clipped after 1000 chars, total length is 5932]
        57145 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-4 >>> --> file://..%5C..%5C.exceptions%5C?fileName=%24%7Bdate%3Anow%3AyyyyMMdd%7D%5C%24%7Bfile%3Aname.noext%7D%24%7Bdate%3Anow%3AyyyyMMddHHmmssSSS%7D-errorOnException.%24%7Bfile%3Aext%7D <<< Pattern:InOnly, Headers:

        {CamelRedeliveryCounter=0, CamelFileNameProduced=..\..\.exceptions\20121010\20121010135507506-errorOnException., CamelRedelivered=false, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-3, CamelRedeliveryMaxCounter=1}

        , BodyType:String, Body:Exception occured: java.lang.NullPointerException
        File name: null
        java.lang.NullPointerException
        com.it.ids.exceptions.HandleException.process(HandleException.java:20)
        org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
        org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
        org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcesso... [Body clipped after 1000 chars, total length is 5932]

        57355 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] ERROR org.apache.camel.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID-tyuhaPC-51641-1349866455403-4-3 on ExchangeId: ID-tyuhaPC-51641-1349866455403-4-4). Exhausted after delivery attempt: 1 caught: java.lang.NullPointerException. Processed by failure processor: FatalFallbackErrorHandler[Pipeline[[Channel[Wrap[com.it.ids.exceptions.HandleException@1919e73] -> com.it.ids.exceptions.HandleException@1919e73], Channel[sendTo(Endpointfile://..%5C..%5C.exceptions%5C?fileName=%24%7Bdate%3Anow%3AyyyyMMdd%7D%5C%24%7Bfile%3Aname.noext%7D%24%7Bdate%3Anow%3AyyyyMMddHHmmssSSS%7D-errorOnException.%24%7Bfile%3Aext%7D)]]]]
        java.lang.NullPointerException
        at com.it.ids.exceptions.HandleException.process(HandleException.java:20)
        at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        at org.apache.camel.processor.FatalFallbackErrorHandler.processNext(FatalFallbackErrorHandler.java:42)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        at org.apache.camel.processor.RedeliveryErrorHandler.deliverToFailureProcessor(RedeliveryErrorHandler.java:759)
        at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:273)
        at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)
        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
        at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
        at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
        at org.apache.camel.impl.BridgeExceptionHandlerToErrorHandler.handleException(BridgeExceptionHandlerToErrorHandler.java:70)
        at org.apache.camel.impl.BridgeExceptionHandlerToErrorHandler.handleException(BridgeExceptionHandlerToErrorHandler.java:53)
        at org.apache.camel.impl.DefaultConsumer.handleException(DefaultConsumer.java:112)
        at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:303)
        at org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(RemoteFileConsumer.java:94)
        at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:189)
        at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:155)
        at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:139)
        at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:91)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
        62405 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-6 >>> () from(ftp://192.168.0.81:21/input?binary=false&consumer.bridgeErrorHandler=true&delay=5000&delete=true&include=.*&localWorkDirectory=.tmp&maxMessagesPerPoll=100&passiveMode=false&password=mypass&pollStrategy=%23ftpPollStrategy&readLock=rename&throwExceptionOnConnectFailed=true&username=tyuha) --> OnException[NullPointerException] <<< Pattern:InOnly, Headers:

        {CamelRedeliveryMaxCounter=1, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-5, CamelRedeliveryCounter=0, CamelRedelivered=false}

        , BodyType:String, Body:Endpointftp://192.168.0.81:21/input?binary=false&consumer.bridgeErrorHandler=true&delay=5000&delete=true&include=.*&localWorkDirectory=.tmp&maxMessagesPerPoll=100&passiveMode=false&password=******&pollStrategy=%23ftpPollStrategy&readLock=rename&throwExceptionOnConnectFailed=true&username=tyuha cannot begin processing file: GenericFile[inputFile] due to: null

        Show
        KaterynaDanyliuk added a comment - Sorry for delay. So endpoints: <endpoint id="ftpSource1" uri="ftp://192.168.0.81:21/input?pollStrategy=#ftpPollStrategy&throwExceptionOnConnectFailed=true&binary=false&passiveMode=false&readLock=rename&delete=true&include=.*&delay=5000&localWorkDirectory=.tmp&username=tyuha&password=mypass&maxMessagesPerPoll=100&consumer.bridgeErrorHandler=true" /> <endpoint id="ftpTarget1" uri="ftp://192.168.0.81:21/output?fileName=$ {file:name} &username=tyuha&password=mypass&binary=false&passiveMode=false&throwExceptionOnConnectFailed=true" /> Route is quite simple: <route id="FTPCustRoute"> <from ref="ftpSource1" /> <to ref="ftpTarget1" /> </route> Not to omit anything: 51310 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO org.apache.camel.component.file.remote.RemoteFileProducer - Connected and logged in to: Endpoint ftp://192.168.0.81:21/output?binary=false&fileName=%24%7Bfile%3Aname%7D&passiveMode=false&password=******&throwExceptionOnConnectFailed=true&username=tyuha 51326 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-2 >>> (FTPCustRoute) from( ftp://192.168.0.81:21/input?binary=false&consumer.bridgeErrorHandler=true&delay=5000&delete=true&include=.*&localWorkDirectory=.tmp&maxMessagesPerPoll=100&passiveMode=false&password=mypass&pollStrategy=%23ftpPollStrategy&readLock=rename&throwExceptionOnConnectFailed=true&username=tyuha ) --> ftp://192.168.0.81:21/output?binary=false&fileName=%24%7Bfile%3Aname%7D&passiveMode=false&password=******&throwExceptionOnConnectFailed=true&username=tyuha <<< Pattern:InOnly, Headers: {CamelFileLastModified=Wed Oct 03 11:37:00 EEST 2012, CamelFileNameOnly=read.txt, CamelFileLength=22, CamelFileHost=192.168.0.81, CamelFileAbsolute=false, CamelFileParent=input, CamelFileNameProduced=output/read.txt, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-1, CamelFilePath=input/read.txt, CamelFileName=read.txt, CamelFileAbsolutePath=input/read.txt, CamelFileRelativePath=read.txt, CamelFileLocalWorkPath=.tmp\read.txt} , BodyType:org.apache.camel.component.file.remote.RemoteFile, Body:[Body is file based: GenericFile [read.txt] ] 56795 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-4 >>> () from( ftp://192.168.0.81:21/input?binary=false&consumer.bridgeErrorHandler=true&delay=5000&delete=true&include=.*&localWorkDirectory=.tmp&maxMessagesPerPoll=100&passiveMode=false&password=mypass&pollStrategy=%23ftpPollStrategy&readLock=rename&throwExceptionOnConnectFailed=true&username=tyuha ) --> OnException [NullPointerException] <<< Pattern:InOnly, Headers: {CamelRedeliveryCounter=0, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-3, CamelRedelivered=false, CamelRedeliveryMaxCounter=1}, BodyType:String, Body:Endpoint ftp://192.168.0.81:21/input?binary=false&consumer.bridgeErrorHandler=true&delay=5000&delete=true&include=.*&localWorkDirectory=.tmp&maxMessagesPerPoll=100&passiveMode=false&password=******&pollStrategy=%23ftpPollStrategy&readLock=rename&throwExceptionOnConnectFailed=true&username=tyuha cannot begin processing file: GenericFile [inputFile] due to: null 56895 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-4 >>> OnException [NullPointerException] --> <<< Pattern:InOnly, Headers:{CamelRedeliveryCounter=0, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-3, CamelRedelivered=false, CamelRedeliveryMaxCounter=1} , BodyType:String, Body:Endpoint ftp://192.168.0.81:21/input?binary=false&consumer.bridgeErrorHandler=true&delay=5000&delete=true&include=.*&localWorkDirectory=.tmp&maxMessagesPerPoll=100&passiveMode=false&password=******&pollStrategy=%23ftpPollStrategy&readLock=rename&throwExceptionOnConnectFailed=true&username=tyuha cannot begin processing file: GenericFile [inputFile] due to: null 56945 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-4 >>> OnException [NullPointerException] --> <<< (OUT), Pattern:InOnly, Headers: {CamelRedeliveryCounter=0, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-3, CamelRedelivered=false, CamelRedeliveryMaxCounter=1}, BodyType:String, Body:Exception occured: java.lang.NullPointerException File name: null java.lang.NullPointerException com.it.ids.exceptions.HandleException.process(HandleException.java:20) org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcesso... [Body clipped after 1000 chars, total length is 5932] 57075 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-4 >>> --> file://..%5C..%5C.exceptions%5C?fileName=%24%7Bdate%3Anow%3AyyyyMMdd%7D%5C%24%7Bfile%3Aname.noext%7D%24%7Bdate%3Anow%3AyyyyMMddHHmmssSSS%7D-errorOnException.%24%7Bfile%3Aext%7D <<< Pattern:InOnly, Headers:{CamelRedeliveryCounter=0, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-3, CamelRedelivered=false, CamelRedeliveryMaxCounter=1} , BodyType:String, Body:Exception occured: java.lang.NullPointerException File name: null java.lang.NullPointerException com.it.ids.exceptions.HandleException.process(HandleException.java:20) org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcesso... [Body clipped after 1000 chars, total length is 5932] 57145 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-4 >>> --> file://..%5C..%5C.exceptions%5C?fileName=%24%7Bdate%3Anow%3AyyyyMMdd%7D%5C%24%7Bfile%3Aname.noext%7D%24%7Bdate%3Anow%3AyyyyMMddHHmmssSSS%7D-errorOnException.%24%7Bfile%3Aext%7D <<< Pattern:InOnly, Headers: {CamelRedeliveryCounter=0, CamelFileNameProduced=..\..\.exceptions\20121010\20121010135507506-errorOnException., CamelRedelivered=false, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-3, CamelRedeliveryMaxCounter=1} , BodyType:String, Body:Exception occured: java.lang.NullPointerException File name: null java.lang.NullPointerException com.it.ids.exceptions.HandleException.process(HandleException.java:20) org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcesso... [Body clipped after 1000 chars, total length is 5932] 57355 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] ERROR org.apache.camel.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID-tyuhaPC-51641-1349866455403-4-3 on ExchangeId: ID-tyuhaPC-51641-1349866455403-4-4). Exhausted after delivery attempt: 1 caught: java.lang.NullPointerException. Processed by failure processor: FatalFallbackErrorHandler[Pipeline[[Channel[Wrap [com.it.ids.exceptions.HandleException@1919e73] -> com.it.ids.exceptions.HandleException@1919e73], Channel[sendTo(Endpoint file://..%5C..%5C.exceptions%5C?fileName=%24%7Bdate%3Anow%3AyyyyMMdd%7D%5C%24%7Bfile%3Aname.noext%7D%24%7Bdate%3Anow%3AyyyyMMddHHmmssSSS%7D-errorOnException.%24%7Bfile%3Aext%7D )]]]] java.lang.NullPointerException at com.it.ids.exceptions.HandleException.process(HandleException.java:20) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.FatalFallbackErrorHandler.processNext(FatalFallbackErrorHandler.java:42) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.RedeliveryErrorHandler.deliverToFailureProcessor(RedeliveryErrorHandler.java:759) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:273) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117) at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86) at org.apache.camel.impl.BridgeExceptionHandlerToErrorHandler.handleException(BridgeExceptionHandlerToErrorHandler.java:70) at org.apache.camel.impl.BridgeExceptionHandlerToErrorHandler.handleException(BridgeExceptionHandlerToErrorHandler.java:53) at org.apache.camel.impl.DefaultConsumer.handleException(DefaultConsumer.java:112) at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:303) at org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(RemoteFileConsumer.java:94) at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:189) at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:155) at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:139) at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:91) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 62405 [Camel (ftpTest) thread #11 - ftp://192.168.0.81:21/input] INFO ExchangeTracer - ID-tyuhaPC-51641-1349866455403-4-6 >>> () from( ftp://192.168.0.81:21/input?binary=false&consumer.bridgeErrorHandler=true&delay=5000&delete=true&include=.*&localWorkDirectory=.tmp&maxMessagesPerPoll=100&passiveMode=false&password=mypass&pollStrategy=%23ftpPollStrategy&readLock=rename&throwExceptionOnConnectFailed=true&username=tyuha ) --> OnException [NullPointerException] <<< Pattern:InOnly, Headers: {CamelRedeliveryMaxCounter=1, breadcrumbId=ID-tyuhaPC-51641-1349866455403-4-5, CamelRedeliveryCounter=0, CamelRedelivered=false} , BodyType:String, Body:Endpoint ftp://192.168.0.81:21/input?binary=false&consumer.bridgeErrorHandler=true&delay=5000&delete=true&include=.*&localWorkDirectory=.tmp&maxMessagesPerPoll=100&passiveMode=false&password=******&pollStrategy=%23ftpPollStrategy&readLock=rename&throwExceptionOnConnectFailed=true&username=tyuha cannot begin processing file: GenericFile [inputFile] due to: null
        Hide
        KaterynaDanyliuk added a comment -

        That's for "input.txt" file in input folder. Files with other names are processed well. For same source uri with slash after directory name everything works fine.

        Show
        KaterynaDanyliuk added a comment - That's for "input.txt" file in input folder. Files with other names are processed well. For same source uri with slash after directory name everything works fine.
        Hide
        Claus Ibsen added a comment -

        The NPE is in your own code, and not in Camel

        java.lang.NullPointerException
        at com.it.ids.exceptions.HandleException.process(HandleException.java:20)
        

        What does the code do?

        Show
        Claus Ibsen added a comment - The NPE is in your own code, and not in Camel java.lang.NullPointerException at com.it.ids.exceptions.HandleException.process(HandleException.java:20) What does the code do?
        Hide
        KaterynaDanyliuk added a comment - - edited

        Well, on exception we send exchange to process HandleException.
        In camel context:

        <onException>
           <process ref="HandleException" />
           <to uri="file: .... />
        </onException>
        

        Code from this class:

           public void process(Exchange exchange) throws Exception {
                Throwable caused = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Throwable.class);
                // line 20:
                caused.fillInStackTrace();
        
        Show
        KaterynaDanyliuk added a comment - - edited Well, on exception we send exchange to process HandleException. In camel context: <onException> <process ref= "HandleException" /> <to uri="file: .... /> </onException> Code from this class: public void process(Exchange exchange) throws Exception { Throwable caused = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Throwable.class); // line 20: caused.fillInStackTrace();
        Hide
        Claus Ibsen added a comment -

        IF you run Camel on Windows but connect to a unix FTP server then I suggest to use separator=Unix as option to tell Camel that its a unix ftp server.

        Show
        Claus Ibsen added a comment - IF you run Camel on Windows but connect to a unix FTP server then I suggest to use separator=Unix as option to tell Camel that its a unix ftp server.

          People

          • Assignee:
            Claus Ibsen
            Reporter:
            KaterynaDanyliuk
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development