tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Teasdale" <pteasd...@betweenmarkets.com>
Subject Specifying a Webapp classloader.
Date Mon, 30 Apr 2001 18:19:38 GMT
Hi Everybody,

I am trying to figure out how to have servlets within a Webapp (context)
use a specified class loader under  Tomcat Version 4.0 Beta... 

Currently, the "tomcat default" classloader used within my servlet is a
URLClassLoader whose codebase is a list of jar:jndi//WEB-INF/lib/ ...!/
elements.

e.g:
Using from the servlet the following code:
 URL[] urls =
((URLClassLoader)this.getClass().getClassLoader()).getURLs();
Will get a list of urls in the following form:
jar:jndi:/WEB-INF/lib/zoo.jar!/

The problem is that URLClassLoaders getClassAnnotation() don't return
the URLs specified in my java.rmi.server.codebase...they simply return
those returned from the call to classloader.getURLs().

This is far from what I want!The only solution I currently have is to
create my own class loader "within" the servlet. 

So...is there a way to configure tomcat so that either:

* it provides me a class loader that is not an instance of a
URLClassLoader?
-or-
* It provides me with a class loader that I explicitly specify for the
context or my Webapp?

thanks,

Paul



Mime
View raw message