Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9238

NPE while GenericFile.changeFileName

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.15.2, 2.15.3
    • 2.16.1, 2.15.5, 2.17.0
    • camel-core
    • None
    • Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
      System: Mac OS X version 10.10.5 running on x86_64; UTF-8; de_DE

    • Unknown

    Description

      If a relative file path is specified for the move or moveFailed Attribute of the file2 component, a NullPointerException is thrown while processing the onCompletion commit resp. rollback strategy.

      And because the processed file cannot be moved away, the processing is restarted again and so on...

      Wrong code line (GenericFile.java:203 in camel-core V2.15.3):

      ObjectHelper.after(newFileName, newEndpointPath + File.separatorChar);
      

      when newFileName and newEndpointPath are both relative paths.

      Stacktrace:

      java.lang.NullPointerException
      	at java.io.File.<init>(File.java:277) ~[?:1.8.0_60]
      	at org.apache.camel.component.file.GenericFile.changeFileName(GenericFile.java:207) ~[camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.component.file.strategy.GenericFileExpressionRenamer.renameFile(GenericFileExpressionRenamer.java:41) ~[camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:87) ~[camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:124) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:80) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:54) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.util.UnitOfWorkHelper.doneSynchronizations(UnitOfWorkHelper.java:104) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:229) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.util.UnitOfWorkHelper.doneUow(UnitOfWorkHelper.java:65) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:637) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:605) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:239) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.processor.Pipeline.process(Pipeline.java:106) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:439) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:211) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:175) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174) [camel-core-2.15.3.jar:2.15.3]
      	at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101) [camel-core-2.15.3.jar:2.15.3]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_60]
      	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_60]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_60]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_60]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_60]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_60]
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            davsclaus Claus Ibsen
            Anchialas Adi König
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment