class loading problem under OSGi

Description

I'm not sure whether to call this a defect or a patch. I'd just like to make you
aware of a blog post (given as URL above) that solved a problem I had when
integrating ROME into Day Communiqué 5, a web content management system based on
Apache Sling (and thus using OSGi bundles to deploy libraries). That blog post
explains that in an OSGi context, using
Thread.currentThread().getContextClassLoader() leads to the wrong class loader.
I followed the advice given there and changed all occurrences of that expression
to this.getClass().getClassLoader() (or {Classname}.class.getClassLoader() in
static contexts) in the ROME source, and this solved my problems. I'm not
familiar enough with class loading issues to say whether this is the right
approach both within and outside of OSGi, just wanted to let you developers know
and leave the issue for you to ponder.

Environment

None

Activity

Show:
UNRESOLVED

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created September 8, 2009 at 8:16 AM
Updated September 8, 2009 at 8:16 AM
Resolved September 8, 2009 at 8:16 AM