Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 20445 invoked from network); 3 Jun 2004 15:09:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 3 Jun 2004 15:09:36 -0000 Received: (qmail 93800 invoked by uid 500); 3 Jun 2004 15:09:36 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 93737 invoked by uid 500); 3 Jun 2004 15:09:36 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 93715 invoked by uid 99); 3 Jun 2004 15:09:36 -0000 Received: from [195.235.176.10] (HELO ivmail2.fcc.es) (195.235.176.10) by apache.org (qpsmtpd/0.27.1) with ESMTP; Thu, 03 Jun 2004 08:09:35 -0700 Received: from fcccorreo1.sg.gr.fcc.es ([10.1.1.190]) by ivmail2 with InterScan Messaging Security Suite; Thu, 03 Jun 2004 17:14:59 +0200 Received: from BLEXC1.sg.gr.fcc.es ([10.1.90.7]) by fcccorreo1.sg.gr.fcc.es with Microsoft SMTPSVC(5.0.2195.6713); Thu, 3 Jun 2004 17:09:13 +0200 content-class: urn:content-classes:message Subject: RV: File remains open Date: Thu, 3 Jun 2004 17:09:13 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: File remains open X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Thread-Index: AcRJV0++spRllqvlTpuDjTRlkvWXagAE+7BgAAP8hvA= From: "Perez Carmona, David" To: "Cocoon (E-mail)" X-OriginalArrivalTime: 03 Jun 2004 15:09:13.0404 (UTC) FILETIME=[BAEC57C0:01C4497C] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Confirmed it happens also in latest Cocoon 2.1.5. Posted bug 29365 in Bugzilla. -----Mensaje original----- De: Perez Carmona, David=0D Enviado el: jueves, 03 de junio de 2004 15:08 Para: Cocoon (E-mail) Asunto: RV: File remains open After having investigated a bit, I discovered that the guilty for leaving= the file opened is a CopySourceAction invokation, that tries to get the= result of the previous pipeline, through the cocoon:// protocol. The following code from org.apache.cocoon.acting.CopySourceAction leaves= the stream opened: public void service(ServiceManager manager) throws ServiceException { super.service(manager); this.resolver =3D= (SourceResolver)manager.lookup(SourceResolver.ROLE); } public Map act(Redirector redirector, SourceResolver oldResolver, Map= objectModel, String source, Parameters par) Source src =3D resolver.resolveURI(source); Source dest =3D resolver.resolveURI(par.getParameter("dest")); =0D // Check that dest is writeable if (! (dest instanceof ModifiableSource)) { throw new IllegalArgumentException("Non-writeable URI : " += dest.getURI()); } =0D ModifiableSource wdest =3D (ModifiableSource)dest; =0D // Get streams InputStream is =3D src.getInputStream(); <----Here the file is= opened forever OutputStream os =3D wdest.getOutputStream(); =0D // And transfer all content. try { byte[] buffer =3D new byte[1024]; int len; while ((len =3D is.read(buffer, 0, buffer.length)) > 0) { os.write(buffer, 0, len); } os.close(); } catch(Exception e) { if (wdest.canCancel(os)) { wdest.cancel(os); } } finally { is.close(); <------This does nothing, because the stream is a= ByteArrayStream } // Success ! return EMPTY_MAP; Is this solved in later versions of Cocoon? -----Mensaje original----- De: Perez Carmona, David=0D Enviado el: jueves, 03 de junio de 2004 12:41 Para: Cocoon (E-mail) Asunto: File remains open Hi all, I have the following pipeline: I have an exception inside the transformer. The result is that the source document remains open (the *.sxw), and I can= not replace it with 3rd party utilities. I'm using Cocoon 2.0.3. Is this solved in newer Cocoon releases? Any= workaround? Thanks in advance for any help. David ************************************************************* Este correo ha sido procesado por el antivirus del Grupo FCC. ************************************************************* --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org