>From the JDK 1.3 Javadoc for ClassLoader.getResource():
This method will first search the parent class loader for the resource; if
the parent is null the path of the class loader built-in to the virtual
machine is searched. That failing, this method will call findResource to
find the resource.

>From the Servlet 2.2 Javadoc for ServletContext.getResource();
This method allows the servlet container to make a resource available to
servlets from any source. Resources can be located on a local or remote file
system, in a database, or in a .war file.

Maybe try using the ServletContext.getResource() instead of the ClassLoader?

> The ClassLoader.getResource* methods do not seem to
> work properly in 1.4.5.  I have been trying to use
> these methods to load resources from my
> WEB-INF/classes directory, and they fail every time.
> After experimenting, I found out that these methods
> expect to load resources from orion/lib.
>
> This seems broken.  I would expect that each webapp
> would have a custom class loader that loads resources
> from the webapp directories - if I need system
> resources I can always use the system class loader
> instead.  This is the way other app servers behave.
>
> The methods work properly if used to access resources
> contained within the webapp's jars, but don't work to
> retrieve plain files.
>
> Is this a known problem in Orion?
>
>
> Roger Vaughn
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/


Reply via email to