You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Dalia,Keith A - TO-DITT1" <ka...@bpa.gov> on 2008/02/11 22:07:58 UTC

Changing the webapp classpath

I was wondering if there was a way to alter the default webapps
classpath.  We use several different .jars in our deployments and would
like to create a directory structure under the web_inf/lib directory.
By default the webapps classloader only looks in web_inf/classes and
web_inf/lib.  Any help is appreciated.

Keith

RE: Changing the webapp classpath

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dalia,Keith A - TO-DITT1 [mailto:kadalia@bpa.gov] 
> Subject: RE: Changing the webapp classpath
> 
> So, I would place the <Loader> in the web.xml that ships with 
> my webapp?

No, it would be in the <Context> element inside your webapp's
META-INF/context.xml file.  <Context> elements should never be placed in
server.xml these days.

 - 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: Changing the webapp classpath

Posted by "Dalia,Keith A - TO-DITT1" <ka...@bpa.gov>.
So, I would place the <Loader> in the web.xml that ships with my webapp?
In the past I've only used the <Context> in the server.xml when defining
virtual sites.

Thanks.

-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Monday, February 11, 2008 2:58 PM
To: Tomcat Users List
Subject: RE: Changing the webapp classpath

> From: "Dalia,Keith A - TO-DITT1" <ka...@bpa.gov>
> Subject: Changing the webapp classpath
> 
> I was wondering if there was a way to alter the default
> webapps classpath.

There's an undocumented capability within Tomcat that provides what
you're asking for.  (Since it's undocumented, I would assume it's also
unsupported, but it may suffice for your needs.)

Inside each <Context> element that needs it, specify a <Loader> element
with the following attributes:
  className="org.apache.catalina.loader.VirtualWebappLoader"
  virtualClasspath="[extraLibraryPaths]"
where [extraLibraryPaths] are a series of path tokens separated by
semicolons (regarless of platform).  Each path token is either absolute
or relative to Tomcat's working directory.

 - 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


---------------------------------------------------------------------
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: Changing the webapp classpath

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: "Dalia,Keith A - TO-DITT1" <ka...@bpa.gov>
> Subject: Changing the webapp classpath
> 
> I was wondering if there was a way to alter the default
> webapps classpath.

There's an undocumented capability within Tomcat that provides what
you're asking for.  (Since it's undocumented, I would assume it's also
unsupported, but it may suffice for your needs.)

Inside each <Context> element that needs it, specify a <Loader> element
with the following attributes:
  className="org.apache.catalina.loader.VirtualWebappLoader"
  virtualClasspath="[extraLibraryPaths]"
where [extraLibraryPaths] are a series of path tokens separated by
semicolons (regarless of platform).  Each path token is either absolute
or relative to Tomcat's working directory.

 - 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: Changing the webapp classpath

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
---------------------------------------------------------------------------
HARBOR: http://coolharbor.100free.com/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
Making the Java dream come true.
---------------------------------------------------------------------------
----- Original Message ----- 
From: "Dalia,Keith A - TO-DITT1" <ka...@bpa.gov>
To: <us...@tomcat.apache.org>
Sent: Monday, February 11, 2008 11:07 PM
Subject: Changing the webapp classpath


I was wondering if there was a way to alter the default webapps
classpath.  We use several different .jars in our deployments and would
like to create a directory structure under the web_inf/lib directory.
By default the webapps classloader only looks in web_inf/classes and
web_inf/lib.  Any help is appreciated.

==============================
I think you outa luck... dont think can be done
But you can modify the Jar names...

MY_xxxxx.jar
YOUR_xxxxx.jar

Almost looks like folders ;)

==============================

Keith


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