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 5E9FA18A7E for ; Wed, 24 Feb 2016 09:08:31 +0000 (UTC) Received: (qmail 32392 invoked by uid 500); 24 Feb 2016 09:08:18 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 32350 invoked by uid 500); 24 Feb 2016 09:08:18 -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 32329 invoked by uid 99); 24 Feb 2016 09:08:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2016 09:08:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 5E8D92C1F76 for ; Wed, 24 Feb 2016 09:08:18 +0000 (UTC) Date: Wed, 24 Feb 2016 09:08:18 +0000 (UTC) From: "Claus Ibsen (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CAMEL-9634) Xtokenize with streaming() does not close stream MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-9634?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen resolved CAMEL-9634. -------------------------------- Resolution: Fixed Thanks for reporting. > Xtokenize with streaming() does not close stream > ------------------------------------------------ > > Key: CAMEL-9634 > URL: https://issues.apache.org/jira/browse/CAMEL-9634 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.16.2 > Reporter: Timo Bredehoeft > Assignee: Claus Ibsen > Priority: Minor > Fix For: 2.15.6, 2.16.3, 2.17.0 > > > If I split a XML-file with xtokenize and streaming() in combination with a move-option on the file-consumer, I get an exception that the file cannot be moved. I assume that the stream is not closed or the file is otherwise still locked. > Simple example route: > from("file:data/xmltest?move=inProcessing/${file:name}") > .split().xtokenize("//order", new Namespaces("", "")).streaming() > .convertBodyTo(String.class) > .to("file:data/output?fileName=dummy.txt") > .end(); > Error stacktrace: > 2016-02-23 11:14:46 WARN GenericFileOnCompletion:136 - Error during commit. Exchange[ID-ZZZZZZZ-52905-1456222481032-0-2][order1.xml]. Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException - Error renaming file from D:\data\xmltest\order1.xml to data\xmltest\inProcessing\order1.xml] > org.apache.camel.component.file.GenericFileOperationFailedException: Error renaming file from D:\data\xmltest\order1.xml to data\xmltest\inProcessing\order1.xml > at org.apache.camel.component.file.FileOperations.renameFile(FileOperations.java:81) > at org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:113) > at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:88) > at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:127) > at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:83) > at org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:57) > at org.apache.camel.util.UnitOfWorkHelper.doneSynchronizations(UnitOfWorkHelper.java:104) > at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:229) > at org.apache.camel.util.UnitOfWorkHelper.doneUow(UnitOfWorkHelper.java:65) > at org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:653) > at org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:608) > at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:239) > at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:250) > at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:491) > at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190) > at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190) > at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:442) > at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:214) > at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:178) > at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174) > at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101) > at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) > at java.util.concurrent.FutureTask.runAndReset(Unknown Source) > at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) > at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) > at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) > at java.lang.Thread.run(Unknown Source) > Caused by: java.io.IOException: Renaming file from 'D:\data\xmltest\order1.xml' to 'data\xmltest\inProcessing\order1.xml' failed: Cannot delete file 'D:\data\xmltest\order1.xml' after copy succeeded > at org.apache.camel.util.FileUtil.renameFileUsingCopy(FileUtil.java:510) > at org.apache.camel.util.FileUtil.renameFile(FileUtil.java:482) > at org.apache.camel.component.file.FileOperations.renameFile(FileOperations.java:78) > ... 27 more -- This message was sent by Atlassian JIRA (v6.3.4#6332)