Index: src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryInputStream.java =================================================================== --- src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryInputStream.java (revision 82778) +++ src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryInputStream.java (revision ) @@ -220,7 +220,6 @@ public void close() throws IOException { streamClosed(true); - super.close(); } /** Index: src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryContext.java =================================================================== --- src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryContext.java (revision 88252) +++ src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryContext.java (revision ) @@ -368,7 +368,7 @@ boolean noReaper = aggregatedOptions.getBooleanOption(VFSUtils.NO_REAPER_QUERY); realURL = urlInfo.toURL(); boolean isAutoClean = autoClean || aggregatedOptions.getBooleanOption(VFSUtils.IS_TEMP_FILE); - return new ZipFileWrapper(file, isAutoClean, noReaper); + return new ZipFileWrapper(this, file, isAutoClean, noReaper); } } @@ -642,6 +642,7 @@ if (initStatus != InitializationStatus.NOT_INITIALIZED) { EntryInfo rootInfo = entries.get(""); + rootInfo.clearChildren(); entries.clear(); entries.put("", rootInfo); Index: src/main/java/org/jboss/virtual/plugins/context/zip/ZipFileWrapper.java =================================================================== --- src/main/java/org/jboss/virtual/plugins/context/zip/ZipFileWrapper.java (revision 87492) +++ src/main/java/org/jboss/virtual/plugins/context/zip/ZipFileWrapper.java (revision ) @@ -74,6 +74,9 @@ /** true if noReaper mode is forced on a per-instance basis */ private boolean noReaperOverride; + /** ZipEntrycontext that owns us */ + private ZipEntryContext ctx; + // used for debugging stream leaks //ConcurrentLinkedQueue streams = new ConcurrentLinkedQueue(); @@ -84,8 +87,9 @@ * @param autoClean should archive be deleted after use * @param noReaperOverride flag to specify if reaper be used or not */ - ZipFileWrapper(File archive, boolean autoClean, boolean noReaperOverride) + ZipFileWrapper(ZipEntryContext ctx, File archive, boolean autoClean, boolean noReaperOverride) { + this.ctx = ctx; this.noReaperOverride = noReaperOverride; init(archive, autoClean); } @@ -193,9 +197,17 @@ zipFile = null; zf.close(); if (forceNoReaper == false && noReaperOverride == false) + { ZipFileLockReaper.getInstance().unregister(this); + + // reset owner context + if (ctx != null) + { + ctx.resetInitStatus(); - } - } + } + } + } + } /** * Get the contents of the given ZipEntry as stream