tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Cote <>
Subject Accessing Context's "lib" path
Date Thu, 04 Jan 2001 03:16:30 GMT
Do I understand this right?

If I place a jar file in a context's lib directory my classes should have 
access to it? When I display System.getProperty("java.class.path") all
that appears is the $CLASSPATH with $TOMCAT_HOME/classes and the jar files 
in the $TOMCAT_HOME/lib directory.

How do my servlets determine where it's supporting classes are? How are any
of my classes (especially my secure classloader) to know the location of 
their servlet context?

According to the API, I can determine that the classes I need are in the
"myclasses.jar" file within the "lib" directory of the WEB-INF directory 
under the directory named the same as my myWebApp.war file, but I have no
idea where myWebApp.war was placed:


How do I figure out $UNKNOWN_PATH?

The end goal is to be able to create a .war file with just one set of 
class files that can be easily deployable by simply placing the .war 
file in the webapps directory. I'm finding that in order to deploy my 
servlet application in Tomcat, I have to place the .war file in the 
webapps directory, extract the particular .jar files and place them in 
the $TOMACT_HOME/lib directory as well. This makes for difficult 

I use my own classloader as a part of an application framework, and this
classloader is integral to the framework, making it undesirable to by-pass
for servlet 2.2 deployment.

It uses the 1.2 delegation model by over-ridding findClass() and letting
loadClass() delegate loading up to the parent classloaders before calling
the custom-written findClass(), and it still cannot find any classes in 
the myclasses.jar. Now I know that myclasses.jar is being accessed, because
the rest of the framework is being loaded via the web.xml deployment file.

Any help would be greatly appreciated.

Steve Cote

View raw message