Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 97810200CB3 for ; Mon, 26 Jun 2017 12:59:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 95FDD160BDE; Mon, 26 Jun 2017 10:59:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DCB2D160BD9 for ; Mon, 26 Jun 2017 12:59:06 +0200 (CEST) Received: (qmail 73816 invoked by uid 500); 26 Jun 2017 10:59:06 -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 73806 invoked by uid 99); 26 Jun 2017 10:59:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jun 2017 10:59:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id AD5A4C061B for ; Mon, 26 Jun 2017 10:59:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id uaWiAyZ3-NzQ for ; Mon, 26 Jun 2017 10:59:04 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 7FDE15F6CB for ; Mon, 26 Jun 2017 10:59:03 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 9E835E0637 for ; Mon, 26 Jun 2017 10:59:02 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2E48B240C4 for ; Mon, 26 Jun 2017 10:59:01 +0000 (UTC) Date: Mon, 26 Jun 2017 10:59:01 +0000 (UTC) From: "Adrien PAILHES (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CAMEL-11454) camel-zipfile does cannot move file after succesful processing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 26 Jun 2017 10:59:07 -0000 [ https://issues.apache.org/jira/browse/CAMEL-11454?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrien PAILHES updated CAMEL-11454: ----------------------------------- Summary: camel-zipfile does cannot move file after succesful processing (was: Camel ZipFile does cannot move file after succesful processing) > camel-zipfile does cannot move file after succesful processing > -------------------------------------------------------------- > > Key: CAMEL-11454 > URL: https://issues.apache.org/jira/browse/CAMEL-11454 > Project: Camel > Issue Type: Bug > Components: camel-zipfile > Affects Versions: 2.18.3 > Environment: Windows 7 x64 > Reporter: Adrien PAILHES > Assignee: onder sezgin > Priority: Minor > > When creating a route as follows: > {code:xml} > > xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util" > xsi:schemaLocation=" > http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd > http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd > http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd > http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd"> > > > > > > > > > ${body} > > > > > > > > {code} > the renaming of the file fails with > {code} > Renaming file from 'C:\camelTest\in\20161201T0030Z_1D_BE00_EQ.zip' to 'C:\camelTest\in\.camel\20161201T0030Z_1D_BE00_EQ.zip' failed: Cannot delete file 'C:\camelTest\in\20161201T0030Z_1D_BE00_EQ.zip' after copy succeeded > {code} > The file stays in input folder and gets processed over and over again. > h2. Investigation > Problem only occurs if: > * you try to move the file at the end of the exchange (not with noop but with delete, for example) > * if ZipFile dataformat is used (not with ZipSplitter) > * if usingIterator is true (not if false and Zip file with 1 entry) > It's because in org.apache.camel.dataformat.zipfile.ZipIterator constructor: > {code} > InputStream inputStream = inputMessage.getBody(InputStream.class); > {code} > will create a new input stream instead of using the one already opened: inputStream parameter when using org.apache.camel.dataformat.zipfile.ZipFileDataFormat#unmarshal. > This one won't be closed and you won't be able to release the resource unless you kill the process. > So, two solutions: > * close the inputStream parameter in org.apache.camel.dataformat.zipfile.ZipFileDataFormat#unmarshal before using ZipIterator constructor > * use inputStream parameter instead of creating a new one when using dataformat (that's the implementation provided in the pull request) -- This message was sent by Atlassian JIRA (v6.4.14#64029)