Replace Class.forName(...) with ClassLoader.loadClass(...) to avoid ClassCastException when running inside an OSGi container

Description

Please see
http://blog.bjhargrave.com/2007/09/classforname-caches-defined-class-in.html for
explanation.

The problem I encountered is that the client of my OSGi bundle also uses rome
and has already loaded those classes defined in rome.properties. When the
PluginManager in my bundle tries to load these classes, the typecast fails.

Replacing Class.forName in Pluginmanager with ClassLoader.loadClass fixes the
problem.

Environment

None

Status

Assignee

ROME Jira Lead

Reporter

ozgwei

Labels

None

Participants

None

Fix versions

Affects versions

current

Priority

Major