You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Dehmlow <de...@gmail.com> on 2008/09/10 18:10:41 UTC

JVM per Context

I have multiple contexts that are defined for a given host in my server.xml
each context I would like to start up in its own jvm, for dll and
enviornment variable reasons.
Here's an example of my server.xml:

<Host name="localhost" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">

       	 <Context path="/eclipse/A"     docBase="/eclipsev1">
   	    <!--I want to load dllv1.dll-->
   	    <!--I want to set the env var 'slot' to ''A'-->
   	    <Parameter name="com.dev.myParm" value="eclipse/A"
override="false"/>
         </Context>

       	 <Context path="/eclipse/B"     docBase="/eclipsev2">
   	    <!--I want to load dllv2.dll-->
   	    <!--I want to set the env var 'slot' to 'B'-->
   	    <Parameter name="com.dev.myParm" value="eclipse/B"
override="false"/>
         </Context>
</host>

I've read documentation for tomcat 3.4 that details the use of ajp for
communication to achieve this but can't find anything about jvms docs.

Thanks for any help,
Mike
 
-- 
View this message in context: http://www.nabble.com/JVM-per-Context-tp19414891p19414891.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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: JVM per Context

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

Chuck,

Caldarale, Charles R wrote:
>> From: Martin Gainty [mailto:mgainty@hotmail.com]
>> Subject: RE: JVM per Context
>>
>> If your goal is to run TC with different JVMs have you looked
>> at using each JBM to run embedded Tomcat<BR>
> 
> This has nothing to do with running an embedded Tomcat. Please don't
> add confusion to this issue.

The use of a 6-year old article was a nice touch, though. Definitely
expanding his repertoire. Keep up the good work, Martin!

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

iEYEARECAAYFAkjJTOIACgkQ9CaO5/Lv0PBDbgCfW3nwR1+Io0DvlYgK88d6CXhh
ebAAn2SskCkDj29PWeSB2deH5YgbAiKW
=mofP
-----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


RE: JVM per Context

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Subject: RE: JVM per Context
>
> If your goal is to run TC with different JVMs have you looked
> at using each JBM to run embedded Tomcat<BR>

This has nothing to do with running an embedded Tomcat.  Please don't add confusion to this issue.

 - 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: JVM per Context

Posted by Martin Gainty <mg...@hotmail.com>.
Mike<BR>

If your goal is to run TC with different JVMs have you looked at using each JBM to run embedded Tomcat<BR>
http://www.onjava.com/pub/a/onjava/2002/04/03/tomcat.html?page=1<BR>

?<BR>
Martin<BR> 
______________________________________________ <BR>
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


> Date: Thu, 11 Sep 2008 00:56:42 +0100
> From: p@pidster.com
> To: users@tomcat.apache.org
> Subject: Re: JVM per Context
> 
> Michael Dehmlow wrote:
> > Thanks, my version of tomcat 5.5.26. My mistake I was looking at tomcat 3.3
> > documentation:
> > http://tomcat.apache.org/tomcat-3.3-doc/tomcat-apache-howto.html
> > http://tomcat.apache.org/tomcat-3.3-doc/tomcat-apache-howto.html .
> > 
> > Yes defining contexts in the Server.xml is discouraged but I'm doing it
> > anyway. ;)
> 
> Strongly suggested.
> 
> > For those in a similar situation I'm going down the path of defining an
> > engine per context:
> 
> Still won't give you separate JVMs.
> 
> As Peter and Chuck indicated, you'll need to create separate Tomcat
> instances if you want to have separate JVMs.  When you start Tomcat you
> are calling Java's JVM first, then Tomcat runs inside of it.
> 
> If you want another JVM instance you have to start another completely
> external process.  The JVMs don't run inside Tomcat, it's the other way
> round.
> 
> 
> >     <Engine name="engA" defaultHost="localhost" jvmRoute="jvmA">
> >       <Host name="localhost" appBase="webapps"
> >        unpackWARs="true"
> >        xmlValidation="false" xmlNamespaceAware="false">
> > 		<Context path="/eclipse/A"     docBase="/slot_A" cookies='false'>
> > 		    <Parameter name="com.dev.myParm" value="/eclipse/A" override="true"/>
> > 		</Context>
> >       </Host>
> >     </Engine>
> > 
> > Using jvmRoute the idea is to use the clustering mechanism of tomcat to give
> > me multiple jvms....
> 
> I think you're mistaking jvmRoute for something it isn't.
> 
> This attribute is used to add a marker to the jsessionid so that routing
>  devices in front of a cluster of Tomcat servers can determine which
> server to send a sticky session to.
> 
>  http://tomcat.apache.org/tomcat-5.5-doc/config/engine.html
> 
> 
> > This being only my theory I can only hope someone can either call me an
> > idiot or give me a few pointers in short order.
> 
>  http://tomcat.apache.org/tomcat-5.5-doc/
> 
> 
> p
> 
> 
> 
> > I will post my findings as I find them.
> > Thanks, 
> > Mike
> 
> 
> ---------------------------------------------------------------------
> 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
> 

_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/

Re: JVM per Context

Posted by Pid <p...@pidster.com>.
Michael Dehmlow wrote:
> Thanks, my version of tomcat 5.5.26. My mistake I was looking at tomcat 3.3
> documentation:
> http://tomcat.apache.org/tomcat-3.3-doc/tomcat-apache-howto.html
> http://tomcat.apache.org/tomcat-3.3-doc/tomcat-apache-howto.html .
> 
> Yes defining contexts in the Server.xml is discouraged but I'm doing it
> anyway. ;)

Strongly suggested.

> For those in a similar situation I'm going down the path of defining an
> engine per context:

Still won't give you separate JVMs.

As Peter and Chuck indicated, you'll need to create separate Tomcat
instances if you want to have separate JVMs.  When you start Tomcat you
are calling Java's JVM first, then Tomcat runs inside of it.

If you want another JVM instance you have to start another completely
external process.  The JVMs don't run inside Tomcat, it's the other way
round.


>     <Engine name="engA" defaultHost="localhost" jvmRoute="jvmA">
>       <Host name="localhost" appBase="webapps"
>        unpackWARs="true"
>        xmlValidation="false" xmlNamespaceAware="false">
> 		<Context path="/eclipse/A"     docBase="/slot_A" cookies='false'>
> 		    <Parameter name="com.dev.myParm" value="/eclipse/A" override="true"/>
> 		</Context>
>       </Host>
>     </Engine>
> 
> Using jvmRoute the idea is to use the clustering mechanism of tomcat to give
> me multiple jvms....

I think you're mistaking jvmRoute for something it isn't.

This attribute is used to add a marker to the jsessionid so that routing
 devices in front of a cluster of Tomcat servers can determine which
server to send a sticky session to.

 http://tomcat.apache.org/tomcat-5.5-doc/config/engine.html


> This being only my theory I can only hope someone can either call me an
> idiot or give me a few pointers in short order.

 http://tomcat.apache.org/tomcat-5.5-doc/


p



> I will post my findings as I find them.
> Thanks, 
> Mike


---------------------------------------------------------------------
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: JVM per Context

Posted by Michael Dehmlow <de...@gmail.com>.
Thanks, my version of tomcat 5.5.26. My mistake I was looking at tomcat 3.3
documentation:
http://tomcat.apache.org/tomcat-3.3-doc/tomcat-apache-howto.html
http://tomcat.apache.org/tomcat-3.3-doc/tomcat-apache-howto.html .

Yes defining contexts in the Server.xml is discouraged but I'm doing it
anyway. ;)

For those in a similar situation I'm going down the path of defining an
engine per context:

    <Engine name="engA" defaultHost="localhost" jvmRoute="jvmA">
      <Host name="localhost" appBase="webapps"
       unpackWARs="true"
       xmlValidation="false" xmlNamespaceAware="false">
		<Context path="/eclipse/A"     docBase="/slot_A" cookies='false'>
		    <Parameter name="com.dev.myParm" value="/eclipse/A" override="true"/>
		</Context>
      </Host>
    </Engine>

Using jvmRoute the idea is to use the clustering mechanism of tomcat to give
me multiple jvms....

This being only my theory I can only hope someone can either call me an
idiot or give me a few pointers in short order.

I will post my findings as I find them.
Thanks, 
Mike
-- 
View this message in context: http://www.nabble.com/JVM-per-Context-tp19414891p19420413.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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: JVM per Context

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Michael Dehmlow [mailto:dehmlowm@gmail.com]
> Subject: JVM per Context
>
> I have multiple contexts that are defined for a given host in
> my server.xml

Placing <Context> elements in server.xml is strongly discouraged for any current version of Tomcat; however, you didn't bother to tell us what version of Tomcat you're using, so that may or may not be applicable.

> each context I would like to start up in its own jvm, for dll and
> enviornment variable reasons.

Each Tomcat runs in its own JVM, so you'll need separate installations for each webapp.  Look in the RUNNING.txt file for instructions.

> I've read documentation for tomcat 3.4 that details the use of ajp for
> communication to achieve this but can't find anything about jvms docs.

Since there never has been nor ever will be a Tomcat 3.4, what you were looking at is rather suspect.

You will need some sort of front end to route the requests to the different Tomcat instances, which could be httpd or some other forwarding mechanism.  Consult the Tomcat connector documentation for whatever level you're using to figure out how to use mod_jk or mod_proxy.

 - 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: JVM per Context

Posted by Peter Crowther <Pe...@melandra.com>.
> From: Michael Dehmlow [mailto:dehmlowm@gmail.com]
> I have multiple contexts that are defined for a given host in
> my server.xml
> each context I would like to start up in its own jvm, for dll and
> enviornment variable reasons.

As a solution sketch (I've never done it), you'll need to deploy eclipsev1 and eclipsev2 in two different Tomcat instances.  See the file RUNNING.txt that comes with your version of Tomcat (which you didn't tell us!) for details on setting up multiple instances.  You'll then need something that talks AJP or can reverse proxy to sit at the front of the two Tomcats and divide incoming requests to the multiple Tomcats.  Apache httpd (what most people call "Apache") can do this.  Again, check the docs at http://tomcat.apache.org for integration of httpd as a front-end, Tomcat as a back-end.

I suspect you'll get more detailed responses; this is rapid rather than complete!

                - Peter

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