Locked jar file under Windows

During the service hot swap mechanism development of NetServe I run into the problem that jar files getting locked under Windows by the JRE.

After some research I found a simple solution for this problem (maybe it’s a performance issue). Before you instanciate a custom classloader you have to disable caching on the URL.

URL url = new URL("path/to/my.jar");
url.openConnection().setDefaultUseCaches(false);

After that, your jar’s won’t get locked.

 
en/dev/lockedjarfile.txt · Last modified: 2007/02/07 01:03 by andy
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki