Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 626C118CF1 for ; Wed, 21 Oct 2015 05:40:28 +0000 (UTC) Received: (qmail 61463 invoked by uid 500); 21 Oct 2015 05:40:28 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 61411 invoked by uid 500); 21 Oct 2015 05:40:28 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 61385 invoked by uid 99); 21 Oct 2015 05:40:28 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Oct 2015 05:40:28 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D7DEF2C1F6A for ; Wed, 21 Oct 2015 05:40:27 +0000 (UTC) Date: Wed, 21 Oct 2015 05:40:27 +0000 (UTC) From: =?utf-8?Q?Adi_K=C3=B6nig_=28JIRA=29?= To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-9238) NPE while GenericFile.changeFileName MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-9238?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1496= 6289#comment-14966289 ]=20 Adi K=C3=B6nig commented on CAMEL-9238: ---------------------------------- Yes, sure: {code} from("file:{{src.uri}}") {code} with properties {noformat} import.dir=3D./import/data src.uri=3D{{import.dir}}?delay=3D{{file.polling.delay}}\ &move=3D${file:parent}.bak/${date:now:yyyyMMdd}/${file:onlyname}\ &moveFailed=3D${file:parent}.err/${date:now:yyyyMMdd}/${file:onlyname} {noformat} > NPE while GenericFile.changeFileName > ------------------------------------ > > Key: CAMEL-9238 > URL: https://issues.apache.org/jira/browse/CAMEL-9238 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.15.2, 2.15.3 > Environment: 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 > Reporter: Adi K=C3=B6nig > > If a relative file path is specified for the {{move}}=C2=A0or {{moveFaile= d}} Attribute of the file2 component, a NullPointerException is thrown whil= e processing the onCompletion commit resp. rollback strategy. > And because the processed file cannot be moved away, the processing is re= started again and so on... > Wrong code line (GenericFile.java:203 in camel-core V2.15.3): > {code:java} > ObjectHelper.after(newFileName, newEndpointPath + File.separatorChar); > {code} > when {{newFileName}}=C2=A0and {{newEndpointPath}} are both relative paths= . > Stacktrace: > {code:java} > java.lang.NullPointerException > =09at java.io.File.(File.java:277) ~[?:1.8.0_60] > =09at org.apache.camel.component.file.GenericFile.changeFileName(GenericF= ile.java:207) ~[camel-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.component.file.strategy.GenericFileExpressionRenam= er.renameFile(GenericFileExpressionRenamer.java:41) ~[camel-core-2.15.3.jar= :2.15.3] > =09at org.apache.camel.component.file.strategy.GenericFileRenameProcessSt= rategy.commit(GenericFileRenameProcessStrategy.java:87) ~[camel-core-2.15.3= .jar:2.15.3] > =09at org.apache.camel.component.file.GenericFileOnCompletion.processStra= tegyCommit(GenericFileOnCompletion.java:124) [camel-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.component.file.GenericFileOnCompletion.onCompletio= n(GenericFileOnCompletion.java:80) [camel-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.component.file.GenericFileOnCompletion.onComplete(= GenericFileOnCompletion.java:54) [camel-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.util.UnitOfWorkHelper.doneSynchronizations(UnitOfW= orkHelper.java:104) [camel-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java= :229) [camel-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.util.UnitOfWorkHelper.doneUow(UnitOfWorkHelper.jav= a:65) [camel-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcess= orAdvice.after(CamelInternalProcessor.java:637) [camel-core-2.15.3.jar:2.15= .3] > =09at org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcess= orAdvice.after(CamelInternalProcessor.java:605) [camel-core-2.15.3.jar:2.15= .3] > =09at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.= done(CamelInternalProcessor.java:239) [camel-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.processor.Pipeline.process(Pipeline.java:106) [cam= el-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.processor.CamelInternalProcessor.process(CamelInte= rnalProcessor.java:190) [camel-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.component.file.GenericFileConsumer.processExchange= (GenericFileConsumer.java:439) [camel-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.component.file.GenericFileConsumer.processBatch(Ge= nericFileConsumer.java:211) [camel-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFil= eConsumer.java:175) [camel-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollCons= umer.java:174) [camel-core-2.15.3.jar:2.15.3] > =09at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsum= er.java:101) [camel-core-2.15.3.jar:2.15.3] > =09at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:= 511) [?:1.8.0_60] > =09at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?= :1.8.0_60] > =09at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTas= k.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_60] > =09at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTas= k.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_60] > =09at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecuto= r.java:1142) [?:1.8.0_60] > =09at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecut= or.java:617) [?:1.8.0_60] > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)