tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chefo <che...@gmail.com>
Subject Re: Access StandardContext in WebappClassLoader
Date Thu, 26 Aug 2010 16:14:59 GMT
Great idea. I'll give it a try immediately!

Thanks a lot,
Chefo

On Thu, Aug 26, 2010 at 6:43 PM, Rainer Jung <rainer.jung@kippdata.de>wrote:

> 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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message