Re: context.xml being deleted out of conf/Catalina/[HOST]/ directory

2010-09-11 Thread Wesley Acheson
On Fri, Sep 10, 2010 at 6:36 PM, Jason Britton jbritto...@gmail.com wrote:
 Could anyone give me an explanation what might cause my webapp's context
 configuration to be deleted out of the tomcat/conf/Catalina/[HOST]/
 directory?  I've got a foo.war file in the webapps directory, it gets
 exploded upon startup. It has its context definition residing in the file
 conf/Catalina/[HOST]/foo.xml.  Every now and then foo.xml just gets up and
 blown away from the tomcat/conf/Catalina/[HOST]/ directory, usually upon a
 tomcat shutdown and startup.  Any suggestions on what might be causing this
 deletion and how to prevent it from occurring would be greatly appreciated.
 Running tomcat 6.0.29 on 64-bit RHEL 5.5.  Thanks a lot for your help,

 Jason


Hi Jason,

If you remove the war file your assoiated context files will be
deleted. Do you think this may be related?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: context.xml being deleted out of conf/Catalina/[HOST]/ directory

2010-09-11 Thread Jason Britton
So even if my context still exists in exploded form in the webapps directory
and I remove the .war form of the context, it'll remove the associated
context.xml from the conf/Catalina/HOST/ directory?


On Sat, Sep 11, 2010 at 8:12 AM, Wesley Acheson wesley.ache...@gmail.comwrote:

 On Fri, Sep 10, 2010 at 6:36 PM, Jason Britton jbritto...@gmail.com
 wrote:
  Could anyone give me an explanation what might cause my webapp's context
  configuration to be deleted out of the tomcat/conf/Catalina/[HOST]/
  directory?  I've got a foo.war file in the webapps directory, it gets
  exploded upon startup. It has its context definition residing in the file
  conf/Catalina/[HOST]/foo.xml.  Every now and then foo.xml just gets up
 and
  blown away from the tomcat/conf/Catalina/[HOST]/ directory, usually upon
 a
  tomcat shutdown and startup.  Any suggestions on what might be causing
 this
  deletion and how to prevent it from occurring would be greatly
 appreciated.
  Running tomcat 6.0.29 on 64-bit RHEL 5.5.  Thanks a lot for your help,
 
  Jason
 

 Hi Jason,

 If you remove the war file your assoiated context files will be
 deleted. Do you think this may be related?

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: context.xml being deleted out of conf/Catalina/[HOST]/ directory

2010-09-11 Thread Wesley Acheson
On Sat, Sep 11, 2010 at 5:20 PM, Jason Britton jbritto...@gmail.com wrote:
 So even if my context still exists in exploded form in the webapps directory
 and I remove the .war form of the context, it'll remove the associated
 context.xml from the conf/Catalina/HOST/ directory?


 On Sat, Sep 11, 2010 at 8:12 AM, Wesley Acheson 
 wesley.ache...@gmail.comwrote:

 On Fri, Sep 10, 2010 at 6:36 PM, Jason Britton jbritto...@gmail.com
 wrote:
  Could anyone give me an explanation what might cause my webapp's context
  configuration to be deleted out of the tomcat/conf/Catalina/[HOST]/
  directory?  I've got a foo.war file in the webapps directory, it gets
  exploded upon startup. It has its context definition residing in the file
  conf/Catalina/[HOST]/foo.xml.  Every now and then foo.xml just gets up
 and
  blown away from the tomcat/conf/Catalina/[HOST]/ directory, usually upon
 a
  tomcat shutdown and startup.  Any suggestions on what might be causing
 this
  deletion and how to prevent it from occurring would be greatly
 appreciated.
  Running tomcat 6.0.29 on 64-bit RHEL 5.5.  Thanks a lot for your help,
 
  Jason
 

 Hi Jason,

 If you remove the war file your assoiated context files will be
 deleted. Do you think this may be related?

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org

Yes I believe so.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: context.xml being deleted out of conf/Catalina/[HOST]/ directory

2010-09-11 Thread Pid *
On 11 Sep 2010, at 17:24, Wesley Acheson wesley.ache...@gmail.com wrote:

 On Sat, Sep 11, 2010 at 5:20 PM, Jason Britton jbritto...@gmail.com wrote:
 So even if my context still exists in exploded form in the webapps directory
 and I remove the .war form of the context, it'll remove the associated
 context.xml from the conf/Catalina/HOST/ directory?


 On Sat, Sep 11, 2010 at 8:12 AM, Wesley Acheson 
 wesley.ache...@gmail.comwrote:

 On Fri, Sep 10, 2010 at 6:36 PM, Jason Britton jbritto...@gmail.com
 wrote:
 Could anyone give me an explanation what might cause my webapp's context
 configuration to be deleted out of the tomcat/conf/Catalina/[HOST]/
 directory?  I've got a foo.war file in the webapps directory, it gets
 exploded upon startup. It has its context definition residing in the file
 conf/Catalina/[HOST]/foo.xml.  Every now and then foo.xml just gets up
 and
 blown away from the tomcat/conf/Catalina/[HOST]/ directory, usually upon
 a
 tomcat shutdown and startup.  Any suggestions on what might be causing
 this
 deletion and how to prevent it from occurring would be greatly
 appreciated.
 Running tomcat 6.0.29 on 64-bit RHEL 5.5.  Thanks a lot for your help,

 Jason


 Hi Jason,

 If you remove the war file your assoiated context files will be
 deleted. Do you think this may be related?

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org

 Yes I believe so.

Removing the war while Tomcat is running will trigger an undeploy. Is
this the situation or is it occurring during a stop start cycle?

A stop shouldn't necessarily cause undeployment, as opposed to app shutdown.


p



 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context.xml being deleted

2010-04-13 Thread Mark Thomas
On 13/04/2010 02:24, Hassan Schroeder wrote:
 On Mon, Apr 12, 2010 at 6:08 PM, Sam Stephens samspad...@gmail.com wrote:
 
 I have a forum application. When we update it we want to distribute a
 new war file (previously we updated all files individually). If we
 give out a new war file to our customers the images directory, the
 attachments directory and other directories that contain user uploaded
 data will be wiped out.

 Is there a solution to this dilemma? Sym links are are no - you'd have
 to remake them each time so still a lot of work.
 
 Well, AFAIK it's either symlinks (which can be scripted in deployment
 processes pretty easily) or put all that stuff in a separate context that
 you never, ever, EVER undeploy :-)
 
 I've used both approaches, can't really say I have a preference. The
 latter might be a little less work, and definitely reduces the exposure
 to symlink oopsies...

Tomcat 7 will have the ability to alias external content into a web
app's url space.

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context.xml being deleted

2010-04-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hassan,

On 4/12/2010 9:24 PM, Hassan Schroeder wrote:
 On Mon, Apr 12, 2010 at 6:08 PM, Sam Stephens samspad...@gmail.com wrote:
 
 I have a forum application. When we update it we want to distribute a
 new war file (previously we updated all files individually). If we
 give out a new war file to our customers the images directory, the
 attachments directory and other directories that contain user uploaded
 data will be wiped out.

 Is there a solution to this dilemma? Sym links are are no - you'd have
 to remake them each time so still a lot of work.
 
 Well, AFAIK it's either symlinks (which can be scripted in deployment
 processes pretty easily) or put all that stuff in a separate context that
 you never, ever, EVER undeploy :-)

You can also put your deployment directory outside the webapps
directory. Those webapps aren't deleted when undeployed, right?

Also, you can put your external content in some other directory, and
write a simple servlet to serve that content based upon URL prefix.

Finally, you can subclass the DefaultServlet and change the way it finds
files so that it finds those files in a separate directory (instead of
within your deployment directory). This is essentially the same as my
second suggestion above except that you get all the benefits of using
the DefaultServlet.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvEcscACgkQ9CaO5/Lv0PB+jACgot4bONZXQLdPz2bPqzJ6EJYm
+9UAn2e7/PFEKsUjL7Wb61GcMAiBtRqs
=P0e7
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context.xml being deleted

2010-04-13 Thread hassan.schroeder
On Tue, Apr 13, 2010 at 6:33 AM, Christopher Schultz
ch...@christopherschultz.net wrote:

 Well, AFAIK it's either symlinks (which can be scripted in deployment
 processes pretty easily) or put all that stuff in a separate context that
 you never, ever, EVER undeploy :-)

Sheesh, yeah. Multitasking #FAIL. Garcon, more coffee, s'il vous plaît!

 You can also put your deployment directory outside the webapps
 directory. Those webapps aren't deleted when undeployed, right?

Honestly, it's been so long since I learned that o-$4!T delete-symlink
lesson that I don't remember where the app was deployed, but you're
probably right.

 Also, you can put your external content in some other directory, and
 write a simple servlet to serve that content based upon URL prefix.

 Finally, you can subclass the DefaultServlet and change the way it finds
 files so that it finds those files in a separate directory (instead of
 within your deployment directory). This is essentially the same as my
 second suggestion above except that you get all the benefits of using
 the DefaultServlet.

And of course those are both true, in increasing order of complexity.

Thanks for adding those, and maybe the whole list should just be in
the FAQ? If it isn't already? (haven't checked)

And where /is/ that coffee?? :-)
-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context.xml being deleted

2010-04-12 Thread Pid *
Which version of Tomcat are you using?


p

On 12 April 2010 01:35, Sam Stephens samspad...@gmail.com wrote:

 Hi all.

 The tomcat documentation says the following:
 If the web application is packaged as a WAR then /META-INF/context.xml
 will be copied to $CATALINA_BASE/conf/[enginename]/[hostname]/ and
 renamed to match the application's context path. Once this file
 exists, it will not be replaced if a new WAR with a newer
 /META-INF/context.xml is placed in the host's appBase.

 However, each time I upload a new WAR the existing context.xml gets
 deleted and replaced with the one inside the WAR file (which is just a
 default). So I lose all my configuration details.

 I have googled and it seems this is a common problem. Any help ?

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




-- 

--
pidster.com


Re: Context.xml being deleted

2010-04-12 Thread Pid *
If you're uploading directly to the webapps directory, try uploading the
file renamed to yourapp.warTMP and renaming it in place when the upload is
complete.

Please let us know if this works/does not work.


p

On 12 April 2010 09:18, Pid * p...@pidster.com wrote:

 Which version of Tomcat are you using?


 p


 On 12 April 2010 01:35, Sam Stephens samspad...@gmail.com wrote:

 Hi all.

 The tomcat documentation says the following:
 If the web application is packaged as a WAR then /META-INF/context.xml
 will be copied to $CATALINA_BASE/conf/[enginename]/[hostname]/ and
 renamed to match the application's context path. Once this file
 exists, it will not be replaced if a new WAR with a newer
 /META-INF/context.xml is placed in the host's appBase.

 However, each time I upload a new WAR the existing context.xml gets
 deleted and replaced with the one inside the WAR file (which is just a
 default). So I lose all my configuration details.

 I have googled and it seems this is a common problem. Any help ?

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




 --

 --
 pidster.com




-- 

--
pidster.com


Re: Context.xml being deleted

2010-04-12 Thread Pid *
I've tried that, it doesn't work. Updating a WAR file will trigger an
undeploy and consequent removal of the context descriptor in a running
Tomcat if the Host autoDeploy attribute is true.

If autoDeploy is false, redeploy without updating the context.xml can occur
using the manager.


p


On 12 April 2010 10:34, Pid * p...@pidster.com wrote:

 If you're uploading directly to the webapps directory, try uploading the
 file renamed to yourapp.warTMP and renaming it in place when the upload is
 complete.

 Please let us know if this works/does not work.


 p

 On 12 April 2010 09:18, Pid * p...@pidster.com wrote:

 Which version of Tomcat are you using?


 p


 On 12 April 2010 01:35, Sam Stephens samspad...@gmail.com wrote:

 Hi all.

 The tomcat documentation says the following:
 If the web application is packaged as a WAR then /META-INF/context.xml
 will be copied to $CATALINA_BASE/conf/[enginename]/[hostname]/ and
 renamed to match the application's context path. Once this file
 exists, it will not be replaced if a new WAR with a newer
 /META-INF/context.xml is placed in the host's appBase.

 However, each time I upload a new WAR the existing context.xml gets
 deleted and replaced with the one inside the WAR file (which is just a
 default). So I lose all my configuration details.

 I have googled and it seems this is a common problem. Any help ?

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




 --

 --
 pidster.com




 --

 --
 pidster.com




-- 

--
pidster.com


Re: Context.xml being deleted

2010-04-12 Thread Sam Stephens
Thanks for the earlier replies.

So after some more research it seems there is no way to tell tomcat
that I don't want particular directories to be deleted on an
application redeploy? Is this correct ?

I have a forum application. When we update it we want to distribute a
new war file (previously we updated all files individually). If we
give out a new war file to our customers the images directory, the
attachments directory and other directories that contain user uploaded
data will be wiped out.

Is there a solution to this dilemma? Sym links are are no - you'd have
to remake them each time so still a lot of work.

Any advice gratefully received.

-- 
-Sam

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context.xml being deleted

2010-04-12 Thread Hassan Schroeder
On Mon, Apr 12, 2010 at 6:08 PM, Sam Stephens samspad...@gmail.com wrote:

 I have a forum application. When we update it we want to distribute a
 new war file (previously we updated all files individually). If we
 give out a new war file to our customers the images directory, the
 attachments directory and other directories that contain user uploaded
 data will be wiped out.

 Is there a solution to this dilemma? Sym links are are no - you'd have
 to remake them each time so still a lot of work.

Well, AFAIK it's either symlinks (which can be scripted in deployment
processes pretty easily) or put all that stuff in a separate context that
you never, ever, EVER undeploy :-)

I've used both approaches, can't really say I have a preference. The
latter might be a little less work, and definitely reduces the exposure
to symlink oopsies...

FWIW,
-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org