Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 7955 invoked from network); 14 Dec 2009 12:11:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Dec 2009 12:11:01 -0000 Received: (qmail 65257 invoked by uid 500); 14 Dec 2009 12:11:01 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 65123 invoked by uid 500); 14 Dec 2009 12:11:00 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 65100 invoked by uid 99); 14 Dec 2009 12:10:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Dec 2009 12:10:59 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [88.84.128.168] (HELO samaflost.de) (88.84.128.168) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Dec 2009 12:10:51 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by samaflost.de (Postfix) with ESMTP id 2FA5140E0005 for ; Mon, 14 Dec 2009 13:10:31 +0100 (CET) Received: from samaflost.de ([127.0.0.1]) by localhost (v35516.1blu.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x4DrgEIu-6aR for ; Mon, 14 Dec 2009 13:10:30 +0100 (CET) Received: by samaflost.de (Postfix, from userid 1000) id 47D7340E0004; Mon, 14 Dec 2009 13:10:30 +0100 (CET) From: Stefan Bodewig To: dev@ant.apache.org Subject: Problem with URL imports from JARs X-Draft-From: ("nnfolder:mail.jakarta-ant") Date: Mon, 14 Dec 2009 13:10:30 +0100 Message-ID: <877hspycw9.fsf@v35516.1blu.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I recognized test failures on my Windows box that I wanted to address before the release. One if the failing tests is import-url-test.xml which fails in the tearDown target because test.jar - from which we import files - hasn't been closed and thus cannot be deleted. Quite obviously closing a stream you obtain from a jar:file: URL will leave the jar file open on Windows (at least using the JDK 1.4 I am testing with). My first idea was to copy the close-logic from URLResource over to FileUtils and use it from ProjectHelper2 so it can close the jar file explicitly. Unfortunately this leads to other problems since the underlying classlib code keeps track of the opened jar files but not of when they get closed and subsequent attempts to read from a closed jar file will cause exceptions. A concrete problem occured in import-url-test.xml itself which failed in the task. ProjectHelper2 would have parsed org/apache/tools/ant/antlib.xml from ant.jar and closed the corresponding jar file after that. The jar task tries to read Ant's default manifest from the classpath and gets an IllegalStateException because that ant.jar is already closed. And there are similiar issues. The test itself would go ahead and import more files from the same jar as well as read a properties file - all these things would fail. Before going even further - like trying to use separate AntClassLoader instances that can be cleaned up per imported JAR URL - I thought I might better ask for ideas. Maybe the "problem" as I see it really isn't such big a problem since the same issue should occur for antlibs as well. Once you've loaded an antlib, you can't delete the jar file that contained it's descriptor as long as the Ant process hasn't finished. Maybe we should document this to be true for imports from jars as well and be done? Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org