https://issues.apache.org/bugzilla/show_bug.cgi?id=56390
Bug ID: 56390 Summary: Tomcat keeps jar files in <app>/WEB-INF/lib opened and app cannot be fully undeployed Product: Tomcat 8 Version: trunk Hardware: PC Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: violet...@apache.org Created attachment 31513 --> https://issues.apache.org/bugzilla/attachment.cgi?id=31513&action=edit Profiling analyses Hi, If there are jar files in <app>/WEB-INF/lib, Tomcat keeps them opened and during undeploy they cannot be cleared. The following error appears: "SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.ExpandWar.delete [...] could not be completely deleted. The presence of the remaining files may cause problems" The problem is because during startup of the application, a call to o.a.catalina.loader.WebappClassLoader.findResource is made, which opens the files. See the profiling analyses that are attached. (openedfiles.jpg) A possible solution would be to invoke java.net.URLClassLoader.close() in org.apache.catalina.loader.WebappClassLoader.stop method: Index: C:/tc8.0.x/java/org/apache/catalina/loader/WebappClassLoader.java =================================================================== --- C:/tc8.0.x/java/org/apache/catalina/loader/WebappClassLoader.java (revision 1585681) +++ C:/tc8.0.x/java/org/apache/catalina/loader/WebappClassLoader.java (working copy) @@ -1497,6 +1497,12 @@ permissionList.clear(); loaderPC.clear(); + + try { + super.close(); + } catch (IOException e) { + throw new LifecycleException(e); + } } What do you think? Regards Violeta -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org