On Tue, 25 May 2004, Stuart Heriot wrote:

> Hi,
> 
> Just a quick question regarding the loading of the OJB.properties file.
> 
> In the load method on 
>   org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl
> it has:
>   URL url =
> Thread.currentThread().getContextClassLoader().getResource(getFilename());
> 
> Is there a reason the Thread's ClassLoader is being used rather than the
> ClassLoader on the Class?
> Such as:
>   URL url = this.getClass().getClassLoader().getResource(getFilename());

AFAIK this is the preferred way to load resources (and classes) in servlet
and EJB containers which may or may not use separate class loaders.
 
> Otherwise when using something such as ClassWorlds it fails to locate the
> file.

Don't know about class worlds, but it may mean that either there is a bug
in class worlds (the currently used class loader should have been set at
the current thread), or simply that the resource is not present ?

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to