abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergio Bossa" <sergio.bo...@gmail.com>
Subject Re: Classloader problems when creating Factory and Parser objects
Date Fri, 11 Jul 2008 08:34:32 GMT
On Thu, Jul 10, 2008 at 7:24 PM, Zeenat Lainwala <lainwala@us.ibm.com> wrote:

> In my product, the abdera classes are packaged in an OSGI bundle. This is
> version 0.4.0. When abdera creates a Factory, Parser, etc, it uses the
> application classloader and the system class loader
> (org.apache.abdera.util.ServiceUtil.java locateInstance) instead of using
> the classloader from
> the bundle. Since the Factory, Parser etc classes are in the bundle, the
> classloading fails.

Hi,

you may try to overwrite the current thread classloader by calling the
following method into your code:
Thread.currentThread().setContextClassLoader(osgiClassloader).
Let us know if it works.
Cheers,

Sergio B.

-- 
Sergio Bossa
Software Passionate, Java Technologies Specialist and Open Source Enthusiast.
Blog : http://sbtourist.blogspot.com
Sourcesense - making sense of Open Source : http://www.sourcesense.com
Pro-netics s.p.a. : http://www.pronetics.it

Mime
View raw message