PLEASE PLEASE STOP SENDING US YOUR E-MAILS...Satalogue --- [EMAIL PROTECTED] wrote:
> remm 2005/02/15 07:42:58 > > Modified: catalina/src/share/org/apache/catalina/startup > HostConfig.java LocalStrings.properties > catalina/src/conf context.xml > Log: > - Tentative fix for 33572: context.xml should be a redeploy resource. > This is done by prioritizing the redeploy resources. > - I need to test this better. The basic cases seem to be working > (editing manager.xml, as well as an expanded folder as per the bug > report). > - Remove context.xml from the list of watched resources. > > Revision Changes Path > 1.55 +36 -23 > jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java > > Index: HostConfig.java > =================================================================== > RCS file: > /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java,v > retrieving revision 1.54 > retrieving revision 1.55 > diff -u -r1.54 -r1.55 > --- HostConfig.java 29 Jan 2005 19:45:55 -0000 1.54 > +++ HostConfig.java 15 Feb 2005 15:42:58 -0000 1.55 > @@ -25,6 +25,7 @@ > import java.io.InputStream; > import java.util.ArrayList; > import java.util.HashMap; > +import java.util.LinkedHashMap; > import java.util.jar.JarEntry; > import java.util.jar.JarFile; > > @@ -572,9 +573,6 @@ > } > context.setConfigFile(contextXml.getAbsolutePath()); > context.setPath(contextPath); > - // Add the context XML to the list of watched files > - deployedApp.reloadResources.put > - (contextXml.getAbsolutePath(), new > Long(contextXml.lastModified())); > // Add the associated docBase to the redeployed list if > it's a WAR > boolean isWar = false; > if (context.getDocBase() != null) { > @@ -628,7 +626,6 @@ > external = true; > deployedApp.redeployResources.put > (contextXml.getAbsolutePath(), new > Long(contextXml.lastModified())); > - > deployedApp.reloadResources.remove(contextXml.getAbsolutePath()); > } > } catch (IOException e) { > // Ignore > @@ -645,8 +642,14 @@ > addWatchedResources(deployedApp, > > expandedDocBase.getAbsolutePath(), context); > } > + // Add the context XML to the list of files > which should trigger a redeployment > + deployedApp.redeployResources.put > + (contextXml.getAbsolutePath(), new > Long(contextXml.lastModified())); > } > } else { > + // Add the context XML to the list of files which > should trigger a redeployment > + deployedApp.redeployResources.put > + (contextXml.getAbsolutePath(), new > Long(contextXml.lastModified())); > addWatchedResources(deployedApp, null, context); > } > } > @@ -904,13 +907,17 @@ > } > context.setPath(contextPath); > context.setDocBase(file); > + File configFile = new File(dir, > Constants.ApplicationContextXml); > if (deployXML) { > - context.setConfigFile > - ((new File(dir, > Constants.ApplicationContextXml)).getAbsolutePath()); > + context.setConfigFile(configFile.getAbsolutePath()); > } > host.addChild(context); > deployedApp.redeployResources.put(dir.getAbsolutePath(), > new Long(dir.lastModified())); > + if (deployXML) { > + > deployedApp.redeployResources.put(configFile.getAbsolutePath(), > + new Long(configFile.lastModified())); > + } > addWatchedResources(deployedApp, dir.getAbsolutePath(), > context); > } catch (Throwable t) { > log.error(sm.getString("hostConfig.deployDir.error", > file), t); > @@ -974,7 +981,9 @@ > if (resource.exists()) { > long lastModified = ((Long) > app.redeployResources.get(resources[i])).longValue(); > if ((!resource.isDirectory()) && > resource.lastModified() > lastModified) { > - // Redeploy application > + // Undeploy application > + if (log.isInfoEnabled()) > + log.info(sm.getString("hostConfig.undeploy", > app.name)); > ContainerBase context = (ContainerBase) > host.findChild(app.name); > host.removeChild(context); > try { > @@ -984,28 +993,32 @@ > ("hostConfig.context.destroy", > app.name), e); > } > // Delete other redeploy resources > - for (int j = 0; j < resources.length; j++) { > - if (j != i) { > - try { > - File current = new > File(resources[j]); > - current = current.getCanonicalFile(); > - if > ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath())) > + for (int j = i + 1; j < resources.length; j++) { > + try { > + File current = new File(resources[j]); > + current = current.getCanonicalFile(); > + if > ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath())) > || > (current.getAbsolutePath().startsWith(configBase().getAbsolutePath()))) > { > - if (log.isDebugEnabled()) > - log.debug("Delete " + > current); > - ExpandWar.delete(current); > - } > - } catch (IOException e) { > - log.warn(sm.getString > - ("hostConfig.canonicalizing", > app.name), e); > + if (log.isDebugEnabled()) > + log.debug("Delete " + current); > + ExpandWar.delete(current); > } > + } catch (IOException e) { > + log.warn(sm.getString > + ("hostConfig.canonicalizing", > app.name), e); > } > } > deployed.remove(app.name); > return; > } > } else { > + long lastModified = ((Long) > app.redeployResources.get(resources[i])).longValue(); > + if (lastModified == 0L) { > + continue; > + } > // Undeploy application > + if (log.isInfoEnabled()) > + log.info(sm.getString("hostConfig.undeploy", > app.name)); > ContainerBase context = (ContainerBase) > host.findChild(app.name); > host.removeChild(context); > try { > @@ -1015,7 +1028,7 @@ > ("hostConfig.context.destroy", > app.name), e); > } > // Delete all redeploy resources > - for (int j = 0; j < resources.length; j++) { > + for (int j = i + 1; j < resources.length; j++) { > try { > File current = new File(resources[j]); > current = current.getCanonicalFile(); > @@ -1277,7 +1290,7 @@ > * contain resources like the context.xml file, a compressed WAR > path. > * The value is the last modification time. > */ > - public HashMap redeployResources = new HashMap(); > + public LinkedHashMap redeployResources = new LinkedHashMap(); > > /** > * Any modification of the specified (static) resources will > cause a > > > > 1.14 +1 -1 > jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/LocalStrings.properties > > === message truncated === ===== FROM SATALOGUE TECHNICAL DEPARTMENT.......WE HAVE READ YOUR E-MAIL... Please call our Duty Engineer on 01332 811564 - for a proper 'one to one' answer as further information and / or clarification is required from you in order to answer your question properly . He is available from 10am until 5pm Monday to Friday inclusive. TO RETURN TO SATALOGUE WEBSITE: Click on to link below..... http://www.satalogue.com/about.htm --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]