Hi, I'm migrating from Tomcat 5.5.0 to the last version offered in http://tomcat.apache.org, 5.5.23. When I try to create new contexts via Admin Tool (/admin), I got a "successful" page, but then checking the Catalina logs I get errors like the following: org.apache.catalina.storeconfig.StandardContextSF storeWithBackup GRAVE: Cannot move orignal context output file at <tomcat_install_dir>/conf/Catalina/localhost/<new_context_name>.xml And no file is written in the folder as expected. Certainly the file doesn't exists, because is a new context and that's the name of the file that must be created. I've tried this in Linux (SuSE Linux 9.2 Professional, Ubuntu 7.04) and Windows XP and with versions 5.5.20 and 5.5.18 with no luck. I've searched in Google and get the reference to bug 37781, "Permission error causes malformed server.xml to be saved.". The fix was the following code: File: StandardContextSF.java protected void storeWithBackup(StandardContext aContext) throws Exception { StoreFileMover mover = getConfigFileWriter((Context) aContext); if (mover != null) { // Bugzilla 37781 Check to make sure we can write this output file if ((mover.getConfigOld() == null) || (!mover.getConfigOld().isFile()) || (!mover.getConfigOld().canWrite())) { log.error("Cannot move orignal context output file at " + mover.getConfigOld()); throw new IOException("Context orginal file at " + mover.getConfigOld() + " is null, not a file or not writable."); } Which suggest that if the "old config file" doesn't exist (like in this case), the whole operation is aborted. If I create the file just before clicking in the button "commit changes" in the admin page, the file writes successfully and I get the context created as expected. In our case we tried to go back to version 5.5.16 (which is the version prior to the fix) and in that version this operation works just fine. Can you check this behavior? Thanks!
Yep, this is broken. I have proposed a patch (http://people.apache.org/~markt/patches/2008-05-10-bug42899.patch) to fix this.
This has been fixed in 5.5.x and will be included in 5.5.27 onwards.