On 26.08.2010 17:24, Chefo wrote:
Hi again

and thanks for the quick responses.

What bothers me in the WebappClassLoader is the fact that before it checks
its repositories (lib folder and classes) and asks its parent class loader,
it will first attempt to load a class from the system class loader - from
the jvm. This is not standard classloader logic but sth done on purpose in
the webapp class loader. I want to prevent that for certain packages and I
want it to be configurable for each web application. That's why I wrote my
WebappClassLoader and configured its usage in the default context.xml
(<Loader loaderClass="org.chefo.OSGiWebappClassLoader"/>  in<catalina
home>/conf/context/xml). I figured the easiest way to configure a list of
packages that should not be loaded through the system class loader is with a
parameter in the context of the web application, thus I need to access a
context parameter in my webapp class loader. I thought it would be normal
for the webapp class loader to be able to access the context that is
associated with it...

Hope that makes it a bit clearer...

You can configure your loader by extending WebappLoader (not only WebappClassLoader) and then using attributes in the loader element you added to context.xml (and corresponding setters in the loader implementation).

For an example see

http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/loader/VirtualWebappLoader.html

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to