diff --git a/src/main/org/apache/tools/ant/AntClassLoader.java b/src/main/org/apache/tools/ant/AntClassLoader.java index 5fc464283..0ccaf32d9 100644 --- a/src/main/org/apache/tools/ant/AntClassLoader.java +++ b/src/main/org/apache/tools/ant/AntClassLoader.java @@ -1107,7 +1107,7 @@ public class AntClassLoader extends ClassLoader implements BuildListener { pathComponents = null; project = null; for (Enumeration e = zipFiles.elements(); e.hasMoreElements();) { - ZipFile zipFile = (ZipFile) e.nextElement(); + ZipFile zipFile = (ZipFile)e.nextElement(); try { zipFile.close(); } catch (IOException ioe) { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java index a0336b24b..783aa42a5 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java @@ -608,7 +608,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { } //Cycle Through generic and make sure its in weblogic - ClassLoader genericLoader = getClassLoaderFromJar(genericJarFile); + ClassLoader genericLoader + = getClassLoaderFromJar(genericJarFile); for (Enumeration e = genericEntries.keys(); e.hasMoreElements();) { String filepath = (String) e.nextElement(); @@ -702,6 +703,11 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { log("Weblogic Jar rebuild needed due to changed " + "interface or XML", Project.MSG_VERBOSE); } + + if (genericLoader instanceof AntClassLoader) { + AntClassLoader loader = (AntClassLoader)genericLoader; + loader.cleanup(); + } } else { rebuild = true; }