You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by da...@cs.berkeley.edu on 2002/03/02 00:12:41 UTC

Re: Classpath Issue

Is there a reason why ${CATALINA_HOME}/classes and
${CATALINA_HOME}/lib is used for shared classes but the corresponding
directories for ${CATALINA_BASE} are not?

We are using ${CATALINA_BASE} to maintain a clean installation of
tomcat4 (which seems to be the point of ${CATALINA_BASE}), but the
problem above is biting us.

Am I missing something?

TIA,
d


At Mon, 25 Feb 2002 18:15:15 +0100,
Jean-Luc BEAUDET wrote:
> 
> rsequeira@transentric.com a écrit :
> 
> > Tomcat takes care of this for you so that you don't have to mess around
> > with classpath issues. Put your  unpacked classes in the WEB-INF/classes
> > directory of you webapplication. jar files go under the WEB-INF/lib. And
> > you are good to go.
> > If you wish to make your classes visible to all applications then place
> > your unpacked classes under then <tomcat_installation_dir>/common/classes.
> 
> Not really recommended since common will have this lib/classes viewed by both
> CATALINA and all web applications. Could be confused in some way...
> 
> Prefer the method of shared:
> $CATALINA_HOME/classes and $CATALINA_HOME/lib assuming CATALINA_HOME is the
> dir where yur Tomcat's dist was installed.
> 
> Hope this will clear the situation...
> 
> Jean-Luc :O)
> 
> 
> >
> > And the packed jar files under <tomcat_installation_dir>/common/lib
> > And if you still wish to add classes to the classpath then check out
> > catalina.bat (or tomcat.bat). But be warned this may give rise to problems
> > with classloading in the future :-)
> >
> > RS
> >
> > "Rui Oliveira" <ol...@milu.ipn.pt> on 02/25/2002 10:51:46 AM
> >
> > Please respond to "Tomcat Users List" <to...@jakarta.apache.org>
> >
> > To:   "Tomcat Users List" <to...@jakarta.apache.org>
> > cc:
> >
> > Subject:  Classpath Issue
> >
> > Hello,
> >
> > sorry for the newbie question...
> >
> > Can someone please tell me how to configure the classpath for a specific
> > application only, instead of defining it for all the tomcat applications?
> >
> > Thanks in advance
> > Rui Oliveira
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Classpath Issue

Posted by da...@cs.berkeley.edu.
Hi Craig,

Thanks for the response; however, perhaps I could provide you
with a concrete use-case example to motivate why I might want
to share from ${CATALINA_BASE}. Alternatively, perhaps you
could advise me on the correct way to address this situation:

We develop several related webapps which rely on the same libraries,
some of which have static content. E.g., we have a DBPoolManager.

In Tomcat 3.x we simply added dbpool.jar to our CLASSPATH before
starting tomcat.

In Tomcat 4, it appears that if we want to share any resources
across two webapps we need to put them into ${CATALINA_HOME}/lib
(or classes).

The libraries for the shared resources are being developed
concurrently with the webapps, so we'd really prefer not to
deploy them out to into the main ${CATALINA_HOME} installation.

Of course, as you said, we could have each developer have a
private copy of Tomcat, but that raises other issues, as I'm
sure you can imagine.

I took a look a the current CVS source for Tomcat 4 and it
looks like in fact this functionality has been added:

% cvs log Bootstrap.java
...
revision 1.30
date: 2001/10/19 05:58:57;  author: remm;  state: Exp;  lines: +14 -6
- The shared classloader is created based on catalina.base
  (instead of catalinaHome). This is experimental.
...

I was able to to add the equivalent changes into the released
Bootstrap.java (-r tomcat_402: 1.26.2.2) and patch them into
${CATALINA_HOME}/bin/bootstrap.jar, so I'm okay for now.

However, I do still believe it's not unreasonable to want this
feature enabled by default.

Thanks,
d


At Fri, 1 Mar 2002 16:26:33 -0800 (PST),
Craig R. McClanahan <cr...@apache.org> wrote:
> 
> 
> 
> On Fri, 1 Mar 2002 daishi@cs.berkeley.edu wrote:
> 
> > Date: Fri, 01 Mar 2002 15:12:41 -0800
> > From: daishi@cs.berkeley.edu
> > Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> > To: Tomcat Users List <to...@jakarta.apache.org>
> > Cc: Jean-Luc BEAUDET <be...@toolchest.cyber.kodak.com>
> > Subject: Re: Classpath Issue
> >
> >
> > Is there a reason why ${CATALINA_HOME}/classes and
> > ${CATALINA_HOME}/lib is used for shared classes but the corresponding
> > directories for ${CATALINA_BASE} are not?
> >
> > We are using ${CATALINA_BASE} to maintain a clean installation of
> > tomcat4 (which seems to be the point of ${CATALINA_BASE}), but the
> > problem above is biting us.
> >
> 
> The original assumption was that, if you wanted to share your Tomcat
> installation, that meant you want to share everything except the
> dynamic stuff (conf, logs, webapps, and work).
> 
> If you really want unique sets of shared JARs as well, you're getting to
> the point where you might just as well install Tomcat more than once.

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Classpath Issue

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 1 Mar 2002 daishi@cs.berkeley.edu wrote:

> Date: Fri, 01 Mar 2002 15:12:41 -0800
> From: daishi@cs.berkeley.edu
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Cc: Jean-Luc BEAUDET <be...@toolchest.cyber.kodak.com>
> Subject: Re: Classpath Issue
>
>
> Is there a reason why ${CATALINA_HOME}/classes and
> ${CATALINA_HOME}/lib is used for shared classes but the corresponding
> directories for ${CATALINA_BASE} are not?
>
> We are using ${CATALINA_BASE} to maintain a clean installation of
> tomcat4 (which seems to be the point of ${CATALINA_BASE}), but the
> problem above is biting us.
>

The original assumption was that, if you wanted to share your Tomcat
installation, that meant you want to share everything except the
dynamic stuff (conf, logs, webapps, and work).

If you really want unique sets of shared JARs as well, you're getting to
the point where you might just as well install Tomcat more than once.

> Am I missing something?
>
> TIA,
> d

Craig


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>