On Tue, Nov 23, 2010 at 9:54 PM, Richard S. Hall <[email protected]> wrote: > On 11/23/10 15:51, Bram de Kruijff wrote: >> >> Hi List, >> >> we are embedding a 3rd party library (in this case Apache Cassandra) >> in a bundle . At startup it uses ClassLoader.getSystemClassLoader to >> load a resource which fails. >> >> 1) Is there a way to intercept this call so that the resource is >> loaded from the bundle classpath? > > No.
Was afraid you where gonna say that >> 2) What would the desired patch on Cassandra be. Eg. ContextClassLoader? > > Shouldn't it be using its own bundle class loader? My guess is the Cassandra developers are not "OSGi aware" and we are just wrapping that library. So in general what best practice pattern should non OSGi projects follow to be "embedable". a) use their own this.getClass().getClassLoader(), b) use the ContextClassLoader so we can switch it c) ... Thanks, Bram --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

