Hi Yoav,
the proposed StoreConfig patch is wrong, but I find a fix. After some testing I see a very strange behaviour.
I test with a referenced war file.
<Context docBase="${catalina.base}/../../webapps/some.war" />
and see at jconsole that docBase is set to "some" and not to the
correct war path.
After I store the context the docBase is remove. That correct
behaviour from StoreConfig for local directory deployment $
{catalina.base}/webapps/some.
But why we remove orginal docBase? How can find the orginal docBase that I configured???
Need help from Remy.... PeterPS: I check in current stage, better work as before, but the fix is not finished.
Am 14.04.2006 um 18:54 schrieb Yoav Shapira:
It seems like a safe check to do and a valid bug use-case, but you know the relevant code better than I, so please check it, and if you think it's bad for some reason feel free to revert the commit, reopen the bug issue, and explain your thoughts... Yoav On 4/14/06, Peter Rossbach <[EMAIL PROTECTED]> wrote:Hi Yoav, that is not the complete story. I start analyse the fix, and find more things .... I hope I can fix it next hour. Cheers Peter Am 14.04.2006 um 16:58 schrieb [EMAIL PROTECTED]:Author: yoavs Date: Fri Apr 14 07:58:10 2006 New Revision: 394113 URL: http://svn.apache.org/viewcvs?rev=394113&view=rev Log: Bugzilla 37781: http://issues.apache.org/bugzilla/show_bug.cgi? id=37781 Modified: tomcat/container/tc5.5.x/modules/storeconfig/src/share/org/ apache/catalina/storeconfig/StandardContextSF.java tomcat/container/tc5.5.x/modules/storeconfig/src/share/org/ apache/catalina/storeconfig/StoreConfig.java tomcat/container/tc5.5.x/webapps/docs/changelog.xml Modified: tomcat/container/tc5.5.x/modules/storeconfig/src/share/ org/apache/catalina/storeconfig/StandardContextSF.java URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/ storeconfig/src/share/org/apache/catalina/storeconfig/ StandardContextSF.java?rev=394113&r1=394112&r2=394113&view=diff==================================================================== ========== --- tomcat/container/tc5.5.x/modules/storeconfig/src/share/org/ apache/catalina/storeconfig/StandardContextSF.java (original) +++ tomcat/container/tc5.5.x/modules/storeconfig/src/share/org/ apache/catalina/storeconfig/StandardContextSF.java Fri Apr 14 07:58:10 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 The Apache Software Foundation. + * Copyright 2004-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -150,6 +150,18 @@ log.info("Store Context " + aContext.getPath() + " separate with backup (at file " + mover.getConfigSave() + " )"); + + // Bugzilla 37781 Check to make sure we can write this output file + if ((mover.getConfigSave() == null) || + (! mover.getConfigSave().isFile()) || + (! mover.getConfigSave().canWrite())) { + log.error("Cannot write context output file at " + + mover.getConfigSave() + ", not saving."); + throw new IOException("Context save file at " + + mover.getConfigSave() + + " is null, not a file, or not writable."); + } + PrintWriter writer = mover.getWriter(); try { storeXMLHead(writer); Modified: tomcat/container/tc5.5.x/modules/storeconfig/src/share/ org/apache/catalina/storeconfig/StoreConfig.java URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/ storeconfig/src/share/org/apache/catalina/storeconfig/ StoreConfig.java?rev=394113&r1=394112&r2=394113&view=diff==================================================================== ========== --- tomcat/container/tc5.5.x/modules/storeconfig/src/share/org/ apache/catalina/storeconfig/StoreConfig.java (original) +++ tomcat/container/tc5.5.x/modules/storeconfig/src/share/org/apache/catalina/storeconfig/StoreConfig.java Fri Apr 14 07:58:10 2006@@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 The Apache Software Foundation. + * Copyright 2004-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/webapps/ docs/changelog.xml?rev=394113&r1=394112&r2=394113&view=diff==================================================================== ========== --- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original) +++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Fri Apr 14 07:58:10 2006 @@ -147,6 +147,9 @@ <bug>38508</bug>: Several enhancements to Host Manager application, including configurable manager app support and dialog box enhancements. Thanks to George Sexton for the patch. (yoavs) </fix> + <fix> + <bug>37781</bug>: Make sure context config file is writeable, suggested by George Sexton. (yoavs) + </fix> </changelog> </subsection> <subsection name="Cluster">-------------------------------------------------------------------- -To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]-- Yoav Shapira Nimalex LLC 1 Mifflin Place, Suite 310 Cambridge, MA, USA [EMAIL PROTECTED] / www.yoavshapira.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
