Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 3782 invoked from network); 16 Sep 2004 13:07:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 16 Sep 2004 13:07:37 -0000 Received: (qmail 43308 invoked by uid 500); 16 Sep 2004 13:06:30 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 43248 invoked by uid 500); 16 Sep 2004 13:06:30 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 43183 invoked by uid 99); 16 Sep 2004 13:06:29 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=DNS_FROM_RFC_ABUSE,FROM_ENDS_IN_NUMS,HTML_20_30,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from [206.190.37.66] (HELO web53505.mail.yahoo.com) (206.190.37.66) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 16 Sep 2004 06:06:28 -0700 Message-ID: <20040916130624.70041.qmail@web53505.mail.yahoo.com> Received: from [213.215.133.146] by web53505.mail.yahoo.com via HTTP; Thu, 16 Sep 2004 15:06:24 CEST Date: Thu, 16 Sep 2004 15:06:24 +0200 (CEST) From: =?iso-8859-1?q?gfdgdf=20gdfgdf?= Subject: RE: How to use a class loaded with a Custom ClassLoader To: Tomcat Users List In-Reply-To: <9C5166762F311146951505C6790A9CF80229C153@US-VS1.corp.mpi.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-2082600145-1095339984=:61652" Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --0-2082600145-1095339984=:61652 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit "Shapira, Yoav" 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' --0-2082600145-1095339984=:61652--