DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42899>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42899

           Summary: Creating a new context via Admin Tool fails when
                    clicking button "commit changes"
           Product: Tomcat 5
           Version: 5.5.23
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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!

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to