You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Larry Isaacs <La...@sas.com> on 2001/10/18 13:58:59 UTC

RE: running multiple instances of the same web app with an applic ation-scope javabean

You could try running the same webapp multiple times on one
Tomcat instance using different context names for each
webapp instance, i.e.

<Context path="/myapp1" docBase="myapp" ...

<Context path="/myapp2" docBase="myapp" ...

Each would have its own application scope attributes, which
I think is what you are asking for.

Hope this helps.

Larry

> -----Original Message-----
> From: Aleksandar Milanovic [mailto:amilanovic@galdosinc.com]
> Sent: Wednesday, October 17, 2001 5:13 PM
> To: Tomcat-User
> Subject: running multiple instances of the same web app with an
> application-scope javabean
> 
> 
> Hi All,
> 
> I want to run multiple instances of the same web app on a 
> single Tomcat 4.0.
> Unfortunately, this web app uses a bean with an "application" session
> context. This bean should be though different for each web 
> app instance
> deployed on the server. I have a few ideas how this could be 
> achieved, but
> am not sure if they're realistic:
> 
> 1. Somehow force Tomcat to run multiple JVM. If this is 
> possible, how I can
> instruct it to run a single web app instance on a given JVM?
> 2. Install multiple instances of Tomcat on the same machine 
> and run a single
> web app instance in each installation.
> 3. Change the bean scope to session, introduce a new init 
> servlet whose
> session starts with the server startup and ends with the 
> server shutdown,
> and share the bean among servlets/JSPs within the same context.
> 
> Is this feasible, and is there a better solution?
> 
> thx
> Alex
> 
> 

RE: running multiple instances of the same web app with an application-scope javabean

Posted by Aleksandar Milanovic <am...@galdosinc.com>.
Thanks Larry. I've already started using contexts, but I didn't know that
application scope was context specific so I removed references to all
application-scope beans and made my program context-aware, i.e. the main
controlling object, of which there must be only one instance, was accessible
by specifying the context name thereby allowing multiple instances of this
object, one per context.
It seems that this is superfluous given what you've told me.

thx
Alex

--
Privileged or confidential information may be contained in this message. If
this message was not intended for you, destroy it and notify us immediately.
Opinions, conclusions, recommendations, and other information presented in
this message are not given or necessarily endorsed by my employer or firm.


> -----Original Message-----
> From: Larry Isaacs [mailto:Larry.Isaacs@sas.com]
> Sent: October 18, 2001 4:59 AM
> To: 'tomcat-user@jakarta.apache.org'
> Subject: RE: running multiple instances of the same web app with an
> application-scope javabean
>
>
> You could try running the same webapp multiple times on one
> Tomcat instance using different context names for each
> webapp instance, i.e.
>
> <Context path="/myapp1" docBase="myapp" ...
>
> <Context path="/myapp2" docBase="myapp" ...
>
> Each would have its own application scope attributes, which
> I think is what you are asking for.
>
> Hope this helps.
>
> Larry
>
> > -----Original Message-----
> > From: Aleksandar Milanovic [mailto:amilanovic@galdosinc.com]
> > Sent: Wednesday, October 17, 2001 5:13 PM
> > To: Tomcat-User
> > Subject: running multiple instances of the same web app with an
> > application-scope javabean
> >
> >
> > Hi All,
> >
> > I want to run multiple instances of the same web app on a
> > single Tomcat 4.0.
> > Unfortunately, this web app uses a bean with an "application" session
> > context. This bean should be though different for each web
> > app instance
> > deployed on the server. I have a few ideas how this could be
> > achieved, but
> > am not sure if they're realistic:
> >
> > 1. Somehow force Tomcat to run multiple JVM. If this is
> > possible, how I can
> > instruct it to run a single web app instance on a given JVM?
> > 2. Install multiple instances of Tomcat on the same machine
> > and run a single
> > web app instance in each installation.
> > 3. Change the bean scope to session, introduce a new init
> > servlet whose
> > session starts with the server startup and ends with the
> > server shutdown,
> > and share the bean among servlets/JSPs within the same context.
> >
> > Is this feasible, and is there a better solution?
> >
> > thx
> > Alex
> >
> >
>
>