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:27:18 GMT
Though similar--and a bit scary--I think this particular issue is different.

Thanks,
Rich

On Tue, Oct 25, 2011 at 12:17 PM, Vimil Saju <vimilsaju@yahoo.com> wrote:

> 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.
>
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014
>
>
>
> ________________________________
> From: Stefan Bodewig <bodewig@apache.org>
> To: user@ant.apache.org
> 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
>
> <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.
>
> > 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,
> yes.
>
> > 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).
>
> Stefan
>
> [1]
> http://mail-archives.apache.org/mod_mbox/ant-dev/200912.mbox/%3C877hspycw9.fsf@v35516.1blu.de%3E
>
> [2]
> http://mail-archives.apache.org/mod_mbox/ant-dev/201003.mbox/%3C87iq9fnif2.fsf@v35516.1blu.de%3E
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>

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