ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vimil Saju <>
Subject Re: ProjectHelper2 fails to close input source after parsing imported document?
Date Tue, 25 Oct 2011 16:17:04 GMT
Could this be due to the urlclassloader bug in Java 6 that keeps jar files open on windows.
I heard that this bug has been fixed in Java 7.

From: Stefan Bodewig <>
Sent: Tuesday, October 25, 2011 8:58 AM
Subject: Re: ProjectHelper2 fails to close input source after parsing imported document?

On 2011-10-25, Steele, Richard wrote:

> I'm chasing a defect with one of my custom Ant tasks.  To summarize, the
> task uses ImportTask under the hood to import build scripts.  These scripts
> can come from jar files downloaded via Ivy.  The problem I'm running into is
> that, at least on Windows, I'm unable to clean the project because Ant has a
> file handle open to the jar file I'm importing from.

I ran into this a few years ago when I wrote the test cases for
importing from an URL.  One result is


I recall blaming the classloader for it [1] and that the workaround I
added only worked for Java 1.4 but not Java6 [2].  It never occured to
me it could be the SAX parser's fault.

> I think what might be happening, and this is just a guess, is that the SAX
> parser is opening the jar file but not closing it.

From your further investigation this may very well be the root cause,

> Clearly this would not be an Ant problem, but I'm wonder if this is
> something anyone else has happened across?

See above.

> I can't believe there would be a file handle leak deep inside the SAX
> parser.  If there is a defect like this, short of reporting it, is
> there anything I can do with Ant to sidestep the issue?

You could try using a different XML parser (Saxon's AElfred, maybe).




To unsubscribe, e-mail:
For additional commands, e-mail:
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message