Howdy,
Use the thread context class loader instead of the system classloader.
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
tcl.getResource(...);

This will work on both the servlet container and command-line
applications.  See the docs page Classloader HOW-TO for more
information.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: mourad jaber [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, June 04, 2003 11:08 AM
>To: Tomcat Users List
>Subject: jar ressource pb
>
>Hi,
>I'm trying to understand the folowing problem :
>I've got some xml files into the jar file of my webapp.
>when I use a stand alone java application to retreive that ressource by
>using ClassLoader.getSystemClassLoader().getResource("myfile.xml") it
>works...
>but it doesn't work any more ( I get null ) when I do it into my
webapp...
>Any suggestion ?
>Thanks a lot
>
>Mourad
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to