You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Gattaz, Olivier" <og...@adonix.fr> on 2002/07/03 18:22:48 UTC

ClassLoaders, Tomcat instances and shared classes

Bonjour,
 
My apologies if you receive this message a second time.
 
Even after I read the class loader documentation (
<http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html>
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html),
the startup documentation (
<http://jakarta.apache.org/tomcat/tomcat-4.0-doc/RUNNING.txt>
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/RUNNING.txt - chapter 4
Advanced Configuration - Multiple Tomcat 4 Instances ) and mailing list
archive,  I am still stuck with the following problem :
 
I choose to run Tomcat 4.0.4 like a WIN2K service with a specific base
folder ($CATALINA_BASE  different than $CATALINA_HOME) to have one tomact
binary install an many tomcat running instances to deploy different versions
of my WebApps (I set the different ports for the the connectors in each
"CATALINA_BASE\conf\server.xml." configuration file) .
 
But no specialized folder like "$CATALINA_BASE/lib" is used by the "Shared
Class loader" to share classes across ALL the web applications running in
ONE Tomcat instance.
Is the unique solution is to copy my shared jar archive in each
"<webapp>/WEB-INF/lib folder" ?
 
How must I do to test several versions of the couple "xerces/xalan" ?
If I replace the xerces.jar archive in the folder
"$CATALINA_HOME\common\lib", all the Tomcat instances use the same parser !
 
I read also the doc "Class Loader HOW-TO" of Tomcat 4.1 and the same
limitation exists, no ?
The capability offered by the specialized folder
"$CATALINA_HOME\common\endorsed" does not solve the  problem !
Will it be possible that the class loader "Common" and "Shared" look if the
folders "$CATALINA_BASE\common\lib", "$CATALINA_BASE\common\endorsed" or
"$CATALINA_BASE\lib" exist ?
If these folders exist, than the present jar files are loaded BEFORE those
stored in the folder "$CATALINA_HOME\common\lib",
"$CATALINA_HOME\common\endorsed"  or "$CATALINA_HOME\lib"
 
Thanks in advance for all your responses.
 
Best regards
 
Olivier Gattaz
Adonix - Les Essarts - Z.A. Les Granges - 12 rue de Lorraine - 38130
Echirolles 
 
 
I use Tomcat 4.0.4 binary distribution.

The context used to defined one WIN2K service corresponding to one Tomcat
instance:
  set CATALINA_HOME=C:\Program Files\Apache Tomcat 4.0
  set CATALINA_BASE=D:\+X3WebGarp\Adonix\X3Web\SERVERS_BASE
  set JAVA_HOME=C:\jdk1.3.1_03
  set JAVA_OPTS=-Dadonix.x3web.install.approot="D:\+X3WebGarp\data"
  set JAVA_OPTS=%JAVA_OPTS%
-Dadonix.x3web.install.progroot="D:\+X3WebGarp\Adonix\X3Web"
  set JAVA_OPTS=%JAVA_OPTS%
-Dadonix.x3web.install.serverbase="%CATALINA_BASE%"
  set JAVA_OPTS=%JAVA_OPTS%
-Djava.library.path="D:\+X3WebGarp\Adonix\X3Web\JNI\X3IMPDLL"
 
 

Olivier Gattaz
Adonix - Les Essarts - Z.A. Les Granges - 12 rue de Lorraine - 38130
Echirolles