tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core StandardHost.java
Date Thu, 05 Oct 2000 01:31:06 GMT
craigmcc    00/10/04 18:31:06

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardHost.java
  Log:
  Add a FIXME note.  The JarURLConnection mechanism seems to cache instances
  of JarFile -- even after you close them!  This prevents you from
  undeploying an application, replacing the JAR file, and redeploying the
  application :-(.  I cannot seem to find a workaround for this at the
  moment.
  
  Revision  Changes    Path
  1.4       +15 -6     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardHost.java	2000/10/04 23:03:04	1.3
  +++ StandardHost.java	2000/10/05 01:31:06	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
1.3 2000/10/04 23:03:04 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/10/04 23:03:04 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
1.4 2000/10/05 01:31:06 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/10/05 01:31:06 $
    *
    * ====================================================================
    *
  @@ -97,7 +97,7 @@
    * requests directed to a particular web application.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/10/04 23:03:04 $
  + * @version $Revision: 1.4 $ $Date: 2000/10/05 01:31:06 $
    */
   
   public final class StandardHost
  @@ -706,14 +706,23 @@
                   (sm.getString("standardHost.docBase",
                                 docBase.getAbsolutePath()));
           docBase.mkdir();
  +        if (debug >= 2)
  +            log("  Have created expansion directory " +
  +                docBase.getAbsolutePath());
   
           // Expand the WAR into the new document base directory
           JarFile jarFile =
               ((JarURLConnection) war.openConnection()).getJarFile();
  +        if (debug >= 2)
  +            log("  Have opened JAR file successfully");
           Enumeration jarEntries = jarFile.entries();
  +        if (debug >= 2)
  +            log("  Have retrieved entries enumeration");
           while (jarEntries.hasMoreElements()) {
               JarEntry jarEntry = (JarEntry) jarEntries.nextElement();
               String name = jarEntry.getName();
  +            if (debug >= 2)
  +                log("  Am processing entry " + name);
               int last = name.lastIndexOf("/");
               if (last >= 0) {
                   File parent = new File(docBase,
  @@ -728,8 +737,9 @@
                   log("  Creating expanded file " + name);
               InputStream input = jarFile.getInputStream(jarEntry);
               expand(input, docBase, name);
  +            input.close();
           }
  -        jarFile.close();
  +        jarFile.close();        // FIXME - doesn't remove from cache!!!
   
           // Return the absolute path to our new document base directory
           return (docBase.getAbsolutePath());
  @@ -761,7 +771,6 @@
               output.write(buffer, 0, n);
           }
           output.close();
  -        input.close();
   
       }
   
  
  
  

Mime
View raw message