You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Chang <dc...@fsautomation.com> on 2004/08/25 02:13:05 UTC

Re: Tomcat deployment issue

Hi,

I'm new to tomcat and trying to figure out how to deploy a WAR file without deleting all the contents of the old application.  That is, I want to overwrite the files with my new archive but not delete any other files that were already there.

The reason I want to do this is because my data and program files are all under the same hierarchy.  I want to replace my programs, but not my data.  I tried using a symbolic link for my data directory, but tomcat followed the symbolic link and deleted everything in there when expanding the new WAR file.

Any help would be appreciated.

DC

Re: Tomcat deployment issue

Posted by Peng Tuck Kwok <pe...@gmail.com>.
Maybe you want to automate the build process so you don't depend on
your expanded directory to store your data ?
Say in ant just generate the war file along with your data (from your
build directory) then deploy it.Then you never really worry what
tomcat does to your war file or the directory it explodes to.
Simply regenerate the war file along with your data when you make changes, :D 


On Tue, 24 Aug 2004 17:13:05 -0700, David Chang <dc...@fsautomation.com> wrote:
> Hi,
> 
> I'm new to tomcat and trying to figure out how to deploy a WAR file without deleting all the contents of the old application.  That is, I want to overwrite the files with my new archive but not delete any other files that were already there.
> 
> The reason I want to do this is because my data and program files are all under the same hierarchy.  I want to replace my programs, but not my data.  I tried using a symbolic link for my data directory, but tomcat followed the symbolic link and deleted everything in there when expanding the new WAR file.
> 
> Any help would be appreciated.
> 
> DC
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Tomcat deployment issue

Posted by Wade Chandler <wc...@redesetgrow.com>.
David Chang wrote:
> Hi,
> 
> I'm new to tomcat and trying to figure out how to deploy a WAR file without deleting all the contents of the old application.  That is, I want to overwrite the files with my new archive but not delete any other files that were already there.
> 
> The reason I want to do this is because my data and program files are all under the same hierarchy.  I want to replace my programs, but not my data.  I tried using a symbolic link for my data directory, but tomcat followed the symbolic link and deleted everything in there when expanding the new WAR file.
> 
> Any help would be appreciated.
> 
> DC
> 

Sure,  but what it sounds like you want to do is just name the context 
differently.  When you deploy the war file if you currently have 
/mywebapp1 then name it /mywebapp2.  You'll now have to versions of your 
webapp deployed on the server in two seperate directories.  You just 
have to access them differently.

It also sounds like you need to come up with a different scheme for your 
data storage.  Maybe place your data store some where else and simply 
have a config file option that tells your app where the data lies? 
Maybe something like that.  Give your app the brains to create it's data 
dir based on that setting and give that dir permissions for the user you 
are running tomcat as.  If you don't want to put the data out yourself 
you app can the first time it is ran and if it is there simply use it. 
Of course you'll have to have a code module for data upgrades or 
something if you ever need to change your data structure...unless you 
keep that basically backward compat some how.

Wade


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Tomcat deployment issue

Posted by David Chang <dc...@fsautomation.com>.
Great suggestion.  I'll try to create a new context to put the data in.

DC

----- Original Message ----- 
From: "QM" <qm...@brandxdev.net>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, August 24, 2004 7:30 PM
Subject: Re: Tomcat deployment issue


> : I'm new to tomcat and trying to figure out how to deploy a WAR file
without deleting all the contents of the old application.
> : [snip]
> : The reason I want to do this is because my data and program files are
all under the same hierarchy.  I want to replace my programs, but not my
data.  I tried using a symbolic link for my data directory, but tomcat
followed the symbolic link and deleted everything in there when expanding
the new WAR file.
>
> You'll benefit, in the long run, from an application redesign.  Java
> webapps are meant to be somewhat self-contained bundles, which is why
> you have the option of deploying in a neat WAR file.  (I may be
> mistaken,  but I recall the spec says it's optional for a container to
> support the exploded-dir format.)
>
> Questions to consider:
>
> - What if your app grows, and needs to be spread amongst 2+ clustered
>   servers?  Where would the data go then?
>
> - How do you migrate from dev -> testing -> production?
>
> etc
>
> Find another place outside of the webapp to put your data, such as
> another directory (specified as a context param or in a properties
> file).
>
> -QM
>
> -- 
>
> software  -- http://www.brandxdev.net
> tech news -- http://www.RoarNetworX.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Tomcat deployment issue

Posted by QM <qm...@brandxdev.net>.
: I'm new to tomcat and trying to figure out how to deploy a WAR file without deleting all the contents of the old application.
: [snip]
: The reason I want to do this is because my data and program files are all under the same hierarchy.  I want to replace my programs, but not my data.  I tried using a symbolic link for my data directory, but tomcat followed the symbolic link and deleted everything in there when expanding the new WAR file.

You'll benefit, in the long run, from an application redesign.  Java
webapps are meant to be somewhat self-contained bundles, which is why
you have the option of deploying in a neat WAR file.  (I may be
mistaken,  but I recall the spec says it's optional for a container to
support the exploded-dir format.)

Questions to consider:

- What if your app grows, and needs to be spread amongst 2+ clustered
  servers?  Where would the data go then?

- How do you migrate from dev -> testing -> production?

etc

Find another place outside of the webapp to put your data, such as
another directory (specified as a context param or in a properties
file).

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org