You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Albert Wold <al...@asu.edu> on 2008/04/02 01:40:08 UTC

Deleting context xml files

Hello,

Recently I have been using per-context XML files in
/usr/local/tomcat/conf/Catalina/localhost to define environment specific
information for my webapps.  That way, when I move a war file through
the cycle of dev/qa/production, I can be sure that I'm running the same
code, and don't have to fiddle with settings inside the war file.

 

I'm not sure when it started happening, but during development it seems
that tomcat is deleting the context xml files at seemingly random times.
I think it has something to do with the undeploy/redeploy process that
happens when the war file changes.  It seems particularly common when
there is a startup error in my app, but it is always when something in
the webapp changes.  Has anyone else experienced this?  I have been
using tomcat 6.0.14, but I just upgraded to 6.0.16 to see if that helps.

 

Basically, I'm wondering if I'm doing something against proper practice
right now that is causing this or if there is some sort of bug in
tomcat.  I am using maven, so I have less control (probably partly
because I a haven't figured it out fully yet) over the copying of files
than I did with ant and I'd be interested to hear what other people are
doing for dev deployment when using context xml files.

 

-Al


Re: Deleting context xml files

Posted by "Mark H. Wood" <mw...@IUPUI.Edu>.
Oh, yes, I've seen that too.  I've spent so much time fighting this
problem that I now keep both 'ctx.xml' and 'ctx.xml.saved' in each
host directory, and always edit the .saved version and copy it over,
so that I don't lose my work when Tomcat destroys the live context
file.

But I haven't seen it happen recently.  I may have been keeping the
affected '.war's in the appbase directory, and then moved them out.
The fundamental rule seems to be:  don't keep any part of your app. in
Tomcat's own directories, except a context specifier, if you expect
Tomcat not to meddle with it.

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
Typically when a software vendor says that a product is "intuitive" he
means the exact opposite.


Re: Deleting context xml files - I have the same...

Posted by fr...@fritid.as.

I have the same, except I have only one context pr virtual server, and uses the war-file as the root-app in each.
When I replace a war-file, the context-files for the other root-apps is deleted - each time. But the context-file for
the replaced war-file is left untouched.'
I use 6.0.16 on jvm 1.6.0_01-b06 on Mandriva.

/Frode




                                                                                                                        
             "Albert Wold" <al...@asu.edu>                                                                             
                                                                                                                        
             02.04.2008 01:39                                                                                        To 
                                                         <us...@tomcat.apache.org>                                      
                                                                                                                     cc 
                      Please respond to                                                                                 
                     "Tomcat Users List"                                                                        Subject 
                  <us...@tomcat.apache.org>              Deleting context xml files                                     
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        
                                                                                                                        




Hello,

Recently I have been using per-context XML files in
/usr/local/tomcat/conf/Catalina/localhost to define environment specific
information for my webapps.  That way, when I move a war file through
the cycle of dev/qa/production, I can be sure that I'm running the same
code, and don't have to fiddle with settings inside the war file.



I'm not sure when it started happening, but during development it seems
that tomcat is deleting the context xml files at seemingly random times.
I think it has something to do with the undeploy/redeploy process that
happens when the war file changes.  It seems particularly common when
there is a startup error in my app, but it is always when something in
the webapp changes.  Has anyone else experienced this?  I have been
using tomcat 6.0.14, but I just upgraded to 6.0.16 to see if that helps.



Basically, I'm wondering if I'm doing something against proper practice
right now that is causing this or if there is some sort of bug in
tomcat.  I am using maven, so I have less control (probably partly
because I a haven't figured it out fully yet) over the copying of files
than I did with ant and I'd be interested to hear what other people are
doing for dev deployment when using context xml files.



-Al




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org