You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rahul <rj...@yahoo.com> on 2007/03/08 08:39:36 UTC

Multiple Instances on one Machine

I am using Tomcat 5.5 to run multiple instances of Tomcat (JVM) on one machine (localhost) using Eclipse. I have two webapps "a" and "b" with their respective web.xml files in $CATALINA_HOME\webapps\WEB-INF. I have two server.xml files (server-a.xml and server-b.xml), one for each webapp with different server and connector ports. 

The $CATALINA_BASE/conf/Catalina/localhost directory contains a.xml and b.xml files with <Context path="/a" docBase="a" debug="0" reloadable="true"/> and <Context path="/b" docBase="b" debug="0" reloadable="true"/> entries respectively. 

Issue: When I start one webapp "b" using Eclipse (program argument = -config "${CATALINA_BASE}\conf\server-b.xml" start), the webapp a is started first and then webapp "b" is started. Vice versa is not true. I am unable to find a reason *why* this webapp "a" is getting started. 

While trying to debug that I am wondering if my way of using two server.xml files for this scenario correct or is there any other way?
(A similar solution is mentioned at http://tomcat.apache.org/tomcat-3.3-doc/tomcat-apache-howto.html although it's a bit legacy version.)

Thanks,
Rahul.


 
____________________________________________________________________________________
It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/

---------------------------------------------------------------------
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


RE: Multiple Instances on one Machine

Posted by Peter Kennard <pe...@livingwork.com>.
I have a related issue. (should the be a separate thread?)

I had two instances of Tomcat5.5 on a windows XP Pro Workstation.
And I had a "batch" file I got off the web to launch the second 
instance using a shared CATALINA_HOME but each with a different CATALINA_BASE

When I upgraded to Tomcat6  it broke the startup.  I tried to modify 
it by changing paths and the like but it failed.

Anyone have an updated method for doing this?
PK

At 09:55 3/8/2007, you wrote:
> > From: Rahul [mailto:rj365@yahoo.com]
> > Subject: Multiple Instances on one Machine
> >
> > I have two webapps "a" and "b" with their respective web.xml
> > files in $CATALINA_HOME\webapps\WEB-INF.



---------------------------------------------------------------------
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


RE: Multiple Instances on one Machine

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Rahul [mailto:rj365@yahoo.com] 
> Subject: Multiple Instances on one Machine
> 
> I have two webapps "a" and "b" with their respective web.xml
> files in $CATALINA_HOME\webapps\WEB-INF.

That's incorrect right there, assuming webapps is declared as the
appBase for your <Host>.  Sounds like yet another case of attempting to
equate appBase and docBase when in fact they must never be the same
location.

> I have two server.xml files (server-a.xml and server-b.xml),
> one for each webapp with different server and connector ports. 

Do the <Host> elements in each of your server-*.xml files declare the
same appBase?  If so, you're going to get both apps deployed in both
Tomcat instances.

> The $CATALINA_BASE/conf/Catalina/localhost directory contains 
> a.xml and b.xml files with <Context path="/a" docBase="a" 
> debug="0" reloadable="true"/> and <Context path="/b" 
> docBase="b" debug="0" reloadable="true"/> entries respectively. 

The path attribute is not allowed in this situation; it is instead
derived from the name of the .xml file.

> While trying to debug that I am wondering if my way of using 
> two server.xml files for this scenario correct or is there 
> any other way?

As Chris pointed out, read RUNNING.txt for the correct mechanism.  Your
current approach will have lots of file collisions between the two
instances, causing no end of grief.

> (A similar solution is mentioned at 
> http://tomcat.apache.org/tomcat-3.3-doc/tomcat-apache-howto.html

Don't use such an ancient set of instructions - it's inappropriate for
version 5.5.  Stick with the doc for the level you've got.

 - 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 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


Re: Multiple Instances on one Machine

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rahul,

Rahul wrote:
> While trying to debug that I am wondering if my way of using two
> server.xml files for this scenario correct or is there any other way?
> (A similar solution is mentioned at
> http://tomcat.apache.org/tomcat-3.3-doc/tomcat-apache-howto.html
> although it's a bit legacy version.)

It won't do exactly what you are trying to do, but try reading the
RUNNING.txt that came with your Tomcat package. There's a section in
there regarding "advanced" configuration where you use a single install
and multiple "base" directories where completely separate configurations
live. So, it's slightly more complicated than just having more than one
server.xml file in your conf directory, but not by much.

- -chris

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

iD8DBQFF8BqA9CaO5/Lv0PARAqXIAKCB+0Yb2CEqIB+Rh47+kO7ejfBHQwCgo8VE
zKjICZHrXRZ1RqqD3rSuacU=
=sW6t
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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