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....@v35516.1blu.de%3E [2] http://mail-archives.apache.org/mod_mbox/ant-dev/201003.mbox/%3c87iq9fnif2....@v35516.1blu.de%3E --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org