tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: How to use a class loaded with a Custom ClassLoader
Date Thu, 16 Sep 2004 13:07:36 GMT

Hi,
Read the Loader configuration reference page:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/loader.html.
Your scenario is not rare, and this Loader approach was developed to
help you out.

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: gfdgdf gdfgdf [mailto:francis17101970@yahoo.it]
>Sent: Thursday, September 16, 2004 9:06 AM
>To: Tomcat Users List
>Subject: RE: How to use a class loaded with a Custom ClassLoader
>
>
>"Shapira, Yoav" <Yoav.Shapira@mpi.com> wrote:
>
>Hi,
>Actually, I'm not sure that would work anyhow. The Class is loaded in
>your ClassLoader, and nowhere else. The Tomcat classloader(s) still
>don't know about it, hence the CNFE.
>
>You would need to declare your Loader in server.xml (or the context.xml
>file for your webapp), and have it extend WebappClassLoader most
likely.
>This would become a pain I imagine, and it means your classloader would
>have to be in common/lib instead of WEB-INF/lib for your webapp.
>
>Yoav Shapira
>Millennium Research Informatics
>
>
>>-----Original Message-----
>>From: Shapira, Yoav
>>Sent: Thursday, September 16, 2004 8:26 AM
>>To: Tomcat Users List
>>Subject: RE: How to use a class loaded with a Custom ClassLoader
>>
>>
>>Hi,
>>
>>> public void contextInitialized(ServletContextEvent event)
>>> {
>>> CustomLoader c = new
>>>CustomLoader(context.getClass().getClassLoader());
>>> Class clazz = c.loadClass("C:\\jakarta-tomcat-
>>>5.0.16\\temp\\","SecretClass",true);
>>
>>If you add Class.forName("SecretClass") after this, does it work or
>>throw a CNFE?
>>
>>Yoav
>>
>>
>>
>>This e-mail, including any attachments, is a confidential business
>>communication, and may contain information that is confidential,
>>proprietary and/or privileged. This e-mail is intended only for the
>>individual(s) to whom it is addressed, and may not be saved, copied,
>>printed, disclosed or used by anyone else. If you are not the(an)
>intended
>>recipient, please immediately delete this e-mail from your computer
>system
>>and notify the sender. Thank you.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>Hello,
>
>thanks for your answers.
>
>You mentioned to declare the classloader in server.xml.
>
>Have you idea how to include this information in server.xml ? I cannot
find
>any reference to Classloaders in it.
>
>Thanks again
>
>Francesco
>
>
>
>---------------------------------
>Scopri Mister Yahoo! -  il fantatorneo sul calcio di Yahoo! Sport'



This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message