ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steele, Richard" <r...@steelezone.net>
Subject Re: ProjectHelper2 fails to close input source after parsing imported document?
Date Tue, 25 Oct 2011 17:24:45 GMT
On Tue, Oct 25, 2011 at 11:58 AM, Stefan Bodewig <bodewig@apache.org> wrote:

> 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
>
> <http://svn.apache.org/viewvc?view=revision&revision=890827>
>
> 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.
>

Yes, I stepped through your code many times trying to debug this problem.
:-) It does look like that code works as long as the only thing I get out of
it is a resource file.  I haven't yet tested any scenarios where I've
actually loaded code from it.  I'm assuming that if/when I come to that I'll
face similar issues, though this time caused by the base classloader holding
onto the classes.

 > 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).
>

I might do that just to prove my analysis, but I was hoping to avoid having
to require everyone to use an extension to Ant.

Thanks,
Rich

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message