Completely FATAL Bug - Ant Unable To Delete JAR

(build 3265, Win 2k)

Went to rebuild the JAR files for my project and found that Ant is unable to delete them. Something is holding a lock on them.

Just how in the heck am I supposed to do any development if I can't rebuild the JAR files at will?

Donald

6 comments
Comment actions Permalink

"Donald McLean" <dmclean@stsci.edu> wrote in message
news:14758760.1111592497327.JavaMail.itn@is.intellij.net...

(build 3265, Win 2k)

>

Went to rebuild the JAR files for my project and found

that Ant is unable to delete them. Something is holding a
lock on them.
>

Just how in the heck am I supposed to do any development

if I can't rebuild the JAR files at will?
>

Donald


Maybe you are in the process or running/debugging your app?


0
Comment actions Permalink

If you're using a web application, you might want to make sure your webapp
container isn't holding locks. I know Tomcat has done this to me before.

(build 3265, Win 2k)

Went to rebuild the JAR files for my project and found that Ant is
unable to delete them. Something is holding a lock on them.

Just how in the heck am I supposed to do any development if I can't
rebuild the JAR files at will?

Donald




0
Comment actions Permalink

You can use a program like TaskInfo (http://www.iarsn.com/taskinfo.html) to show you what processes have a file open.

If you try TaskInfo, you do Search from the menu, and type in the jarfile name, and it will show the processes which have it open.

0
Comment actions Permalink

The web server runs on another computer so it can't be either Tomcat or the debugger.

I'll try the suggested app, but considering the circumstances, it would be highly unlikely that it is anything but IDEA.

I tried 3260 and 3245 and they both have the same problem. It is possible that it has something to do with the web module, but regardless, IDEA should not be holding any locks.

Donald

0
Comment actions Permalink

Hi Donald,
we had same issues here with our installer not beeing able to delete Tomcat application due to locking. In our case it was log4j that was locking log4j.properties file. It could be anything else as I don't know which application server you are using. Try to shutdown Idea and than run ant task, probably you'll not be able to do cleanup.

from tomcat site:
+*
I want to redeploy web applications, how do I prevent resources from getting locked?*

Most locking issues will occur with JARs from /WEB-INF/lib, and are useally caused by access through URLs. Tomcat has mechanisms to allow avoiding locking. In Tomcat 5.0, a mechanism exists to prevent locking when accessing resources using the getResource method of the URL classloader (many applications, such as Xerces, do not set the use of caching to false before opening the URL connection, causing locking). If such a call occurs, resources inside the JARs will be extracted to the work directory of the web application. In Tomcat 5.5, this mechanism is disabled by default (as it has a non negligible influence on startup times, and is often useless), and can be enabled using the antiJARLocking attribute of the Context element. There is another lock prevention mechanism in Tomcat 5.5 (antiResourceLocking attribute), which will cause the web application files to be copied to the temp folder and run from this location. This has a larger impact on web application startup times, but obviously prevents locking on all resources of the web application. This also allows more flexible management operations as none of the web application resources will be locked, even while the web application is running (as a special note, when making changes JSPs without reloading the application, the changes has to be duplicated to the path where the web application resources have been copied in the temp folder).
+

0
Comment actions Permalink

Right, now I recall. We had the same thing with
Tomcat/log4j.
---

"M. J. Milicevic" <me@machak.com> wrote in message
news:2154655.1111660137170.JavaMail.itn@is.intellij.net...
Hi Donald,
we had same issues here with our installer not beeing able
to delete Tomcat application due to locking. In our case it
was log4j that was locking log4j.properties file. It could
be anything else as I don't know which application server
you are using. Try to shutdown Idea and than run ant task,
probably you'll not be able to do cleanup.


0

Please sign in to leave a comment.