You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Majors, Jeremy" <jm...@tribune.com> on 2013/07/01 20:30:20 UTC

Tomcat 7.0.27 on Mac OSX Lion -- Is it Possible to use Tomcat Parallel Deployment when the Context Name is Different than the WAR Name

The application I am working on currently runs in production under multiple contexts within tomcat and we are doing so by creating separate context.xml files for each where we specify the docbase which points to a single directory and each has a unique path value specified. We are currently evaluating the parallel deployment feature of Tomcat and I'm having trouble finding a way to get that to work with our current setup. I've read the tomcat documentation (http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Naming) and it doesn't appear to support our current setup, but I wanted to reach out to the community and ask before we attempt to change how we setup tomcat. Please note, I have been able to get the parallel deployment process to work if we create separate wars for each of our web sites and deploy them individually.  Also, there is logic that understands which "context" the site is running in and loads different configuration files and alters it's behavior based upon the context, so setting up aliases won't work for us (at least not based upon my understanding of how that piece of functionality works).

Does anyone know if our current context configuration can work with the parallel deployment process and if so, how would that be accomplished?

Thanks in advance for your guidance.

Jeremy

RE: Tomcat 7.0.27 on Mac OSX Lion -- Is it Possible to use Tomcat Parallel Deployment when the Context Name is Different than the WAR Name

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Majors, Jeremy [mailto:jmajors@tribune.com] 
> Subject: Re: Tomcat 7.0.27 on Mac OSX Lion -- Is it Possible to use Tomcat 
> Parallel Deployment when the Context Name is Different than the WAR Name

> It appears to be working after I added the information provided by Mark
> (even with the path attribute specified).  Maybe it is just ignoring that
> value.  

It is currently being ignored.  At least some of us would argue that it is cause for rejection of the <Context> element, but it's not implemented that way yet.  Its presence is, at best, confusing, since someone could easily think it might be having some effect.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Tomcat 7.0.27 on Mac OSX Lion -- Is it Possible to use Tomcat Parallel Deployment when the Context Name is Different than the WAR Name

Posted by "Majors, Jeremy" <jm...@tribune.com>.

On 7/1/13 4:03 PM, "Mark Thomas" <ma...@apache.org> wrote:

>On 01/07/2013 22:00, Caldarale, Charles R wrote:
>>> From: Mark Thomas [mailto:markt@apache.org] Subject: Re: Tomcat
>>> 7.0.27 on Mac OSX Lion -- Is it Possible to use Tomcat Parallel
>>> Deployment when the Context Name is Different than the WAR Name
>> 
>>> Assuming the file above is called website1##001.xml
>> 
>>> then you should be able to add website1##002.xml with the following
>>> content: <Context reloadable="true" crossContext="true"
>>> sessionCookiePath="/"
>>> docBase="/Users/jeremy/tomcat/manualDeploy/myapp-v2"
>>> path="/website1"></Context>
>> 
>> Except the path attribute is not allowed here, since it is derived
>> from the name of the .xml file.
>
>Thanks for catching that. I was too busy thinking about parallel
>deployment and missed that one.
>
>Mark

It appears to be working after I added the information provided by Mark
(even with the path attribute specified).  Maybe it is just ignoring that
value.  

Thank you very much!
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>


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


Re: Tomcat 7.0.27 on Mac OSX Lion -- Is it Possible to use Tomcat Parallel Deployment when the Context Name is Different than the WAR Name

Posted by Mark Thomas <ma...@apache.org>.
On 01/07/2013 22:00, Caldarale, Charles R wrote:
>> From: Mark Thomas [mailto:markt@apache.org] Subject: Re: Tomcat
>> 7.0.27 on Mac OSX Lion -- Is it Possible to use Tomcat Parallel
>> Deployment when the Context Name is Different than the WAR Name
> 
>> Assuming the file above is called website1##001.xml
> 
>> then you should be able to add website1##002.xml with the following
>> content: <Context reloadable="true" crossContext="true"
>> sessionCookiePath="/" 
>> docBase="/Users/jeremy/tomcat/manualDeploy/myapp-v2" 
>> path="/website1"></Context>
> 
> Except the path attribute is not allowed here, since it is derived
> from the name of the .xml file.

Thanks for catching that. I was too busy thinking about parallel
deployment and missed that one.

Mark

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


RE: Tomcat 7.0.27 on Mac OSX Lion -- Is it Possible to use Tomcat Parallel Deployment when the Context Name is Different than the WAR Name

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mark Thomas [mailto:markt@apache.org] 
> Subject: Re: Tomcat 7.0.27 on Mac OSX Lion -- Is it Possible to use Tomcat 
> Parallel Deployment when the Context Name is Different than the WAR Name

> Assuming the file above is called website1##001.xml

> then you should be able to add website1##002.xml with the following content:
> <Context reloadable="true" crossContext="true" sessionCookiePath="/"
> docBase="/Users/jeremy/tomcat/manualDeploy/myapp-v2"
> path="/website1"></Context>

Except the path attribute is not allowed here, since it is derived from the name of the .xml file.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Tomcat 7.0.27 on Mac OSX Lion -- Is it Possible to use Tomcat Parallel Deployment when the Context Name is Different than the WAR Name

Posted by Mark Thomas <ma...@apache.org>.
On 01/07/2013 21:50, Majors, Jeremy wrote:
> I have 3 separate context files setup within the conf/Catalina/localhost/
> folder  (examples provided below).
> 
> WebSite1
> <Context reloadable="true" crossContext="true" sessionCookiePath="/"
> docBase="/Users/jeremy/tomcat/manualDeploy/myapp"
> path="/website1"></Context>

Assuming the file above is called website1##001.xml

then you should be able to add website1##002.xml with the following content:
<Context reloadable="true" crossContext="true" sessionCookiePath="/"
docBase="/Users/jeremy/tomcat/manualDeploy/myapp-v2"
path="/website1"></Context>

Adjust file names as necessary for your example. I'd recommend you keep
the docBase file name in sync with the version number in the context.xml
file name.

Mark

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


Re: Tomcat 7.0.27 on Mac OSX Lion -- Is it Possible to use Tomcat Parallel Deployment when the Context Name is Different than the WAR Name

Posted by "Majors, Jeremy" <jm...@tribune.com>.

On 7/1/13 2:27 PM, "Mark Thomas" <ma...@apache.org> wrote:

>On 01/07/2013 19:30, Majors, Jeremy wrote:
>> The application I am working on currently runs in production under
>> multiple contexts within tomcat and we are doing so by creating
>> separate context.xml files for each where we specify the docbase
>> which points to a single directory and each has a unique path value
>> specified. We are currently evaluating the parallel deployment
>> feature of Tomcat and I'm having trouble finding a way to get that to
>> work with our current setup. I've read the tomcat documentation
>> (http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Naming)
>> and it doesn't appear to support our current setup,
>
>In what way?

I have 3 separate context files setup within the conf/Catalina/localhost/
folder  (examples provided below).

WebSite1
<Context reloadable="true" crossContext="true" sessionCookiePath="/"
docBase="/Users/jeremy/tomcat/manualDeploy/myapp"
path="/website1"></Context>


WebSite2
<Context reloadable="true" crossContext="true" sessionCookiePath="/"
docBase="/Users/jeremy/tomcat/manualDeploy/myapp"
path="/website2"></Context>

WebSite3
<Context reloadable="true" crossContext="true" sessionCookiePath="/"
docBase="/Users/jeremy/tomcat/manualDeploy/myapp"
path="/website3"></Context>

We are looking for a way to deploy a new version of the application
"myapp" using the parallel deployment approach so that we minimize
downtime.  I have been unable to get tomcat to recognize the new version
when I deploy myapp##001 via the automatic deployment process or when I
add a myapp##001 to the /Users/jeremy/tomcat/manualDeploy/ folder.  I
suspect it is because parallel deployments don't work if you specify the
path attribute of a context configuration.  I've also tried putting myapp
in the appbase folder, but if I do that then Tomcat gives me an error
stating that I cannot specify a docbase within the appease folder (tried
both absolute and relative paths).





>
>> but I wanted to
>> reach out to the community and ask before we attempt to change how we
>> setup tomcat.
>
>As long as the WAR is outside the host's appBase you should be fine.
>
>> Please note, I have been able to get the parallel
>> deployment process to work if we create separate wars for each of our
>> web sites and deploy them individually.  Also, there is logic that
>> understands which "context" the site is running in and loads
>> different configuration files and alters it's behavior based upon the
>> context, so setting up aliases won't work for us (at least not based
>> upon my understanding of how that piece of functionality works).
>> 
>> Does anyone know if our current context configuration can work with
>> the parallel deployment process and if so, how would that be
>> accomplished?
>
>I don't see any reason why it wouldn't work.
>
>Mark
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>


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


Re: Tomcat 7.0.27 on Mac OSX Lion -- Is it Possible to use Tomcat Parallel Deployment when the Context Name is Different than the WAR Name

Posted by Mark Thomas <ma...@apache.org>.
On 01/07/2013 19:30, Majors, Jeremy wrote:
> The application I am working on currently runs in production under
> multiple contexts within tomcat and we are doing so by creating
> separate context.xml files for each where we specify the docbase
> which points to a single directory and each has a unique path value
> specified. We are currently evaluating the parallel deployment
> feature of Tomcat and I'm having trouble finding a way to get that to
> work with our current setup. I've read the tomcat documentation
> (http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Naming)
> and it doesn't appear to support our current setup,

In what way?

> but I wanted to
> reach out to the community and ask before we attempt to change how we
> setup tomcat.

As long as the WAR is outside the host's appBase you should be fine.

> Please note, I have been able to get the parallel
> deployment process to work if we create separate wars for each of our
> web sites and deploy them individually.  Also, there is logic that
> understands which "context" the site is running in and loads
> different configuration files and alters it's behavior based upon the
> context, so setting up aliases won't work for us (at least not based
> upon my understanding of how that piece of functionality works).
> 
> Does anyone know if our current context configuration can work with
> the parallel deployment process and if so, how would that be
> accomplished?

I don't see any reason why it wouldn't work.

Mark

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