If a log4j configuration file is found by the classpath search inside a JAR file, the file will be loaded from the JAR. However, the initial URLConnection.getDefaultUseCaches() setting means that caching is used and the JAR file is locked. This is a particular problem for container environments like Tomcat, as it prevents a web application from being removed. Whilst the workaround is simple - don't put your log4j configuration in a JAR - it impacts a large number of users. I have a patch and test case for PropertyConfigurator. I still need to test DOMConfigurator. I will update this bug report with the results of that test (and a patch if necessary) later today.
Created attachment 23919 [details] Patch and test cases Test cases to demonstrate the issue and a patch to fix the issue attached. Note the test cases use files paths that work on my machine. These do not appear to be consistent with the other test cases so a few tweaks may be required.
Patch applied to svn trunk in r821433. Thanks Mark!