tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Tiu <>
Subject RE: Problem reading resource file in WEB-INF\lib
Date Thu, 15 May 2003 17:51:58 GMT

It attempts to load the resource file ( like this:

String invdat = "/com/ibm/icu/impl/data/";
InputStream i = invdat.getClass().getResourceAsStream(invdat);
BufferedInputStream b = new BufferedInputStream(i, 110000);

is it that it uses a classloader that isn't looking in WEB-INF\lib??

-----Original Message-----
From: Shapira, Yoav []
Sent: May 15, 2003 10:03 AM
To: Tomcat Users List
Subject: RE: Problem reading resource file in WEB-INF\lib

Can you see what the code in icu4j.jar looks like?  Specifically, which
way does it load the resource?

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: Jonathan Tiu []
>Sent: Thursday, May 15, 2003 12:50 PM
>To: ''
>Subject: Problem reading resource file in WEB-INF\lib
>This is really stumping me so any help would be much appreciated!
>I have a simple web app, called Foo, on Tomcat that makes use of a jar
>called icu4j.jar (IBM ICU library). The jar is
>in the lib directory
>ie.  Foo\WEB-INF\lib\icu4j.jar
>My application fails because it makes a call into the icu library
which, in
>turn, attempts to load a resource file  which is also in the icu4j.jar.
>But the class loader seems to fail loading the resource file. I guess
>can't find it.
>I have read the Tomcat documentation on class loading, etc. and it
>"For classes and resources specific to a particular web application,
>unpacked classes and resources under /WEB-INF/classe of your web
>archive, or place JAR files containing those classes and resources
>/WEB-INF/lib of your web application archive"
>So I don't need to do anymore configuration to tell Tomcat where to
>resource file? I mean, the jar containing the file is in the classpath,
>I was it when my code is run, it invokes the system
>classloader which checks only the CLASSPATH and maybe doesn't check
>It isn't a bug in icu4j.jar because, running my java app outside of
>works perfectly fine.
>Thanks a lot!
>To unsubscribe, e-mail:
>For additional commands, e-mail:

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:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message