return cl.loadClass(name);
} else {
return Class.forName(name);
}
} catch (ClassNotFoundException e) {
throw new ResourceLoadingException("Error loading class " + name, e);
} catch (NoClassDefFoundError e) {
throw new ResourceLoadingException("Error loading class " + name, e);
} catch (TypeNotPresentException e) {
throw new ResourceLoadingException("Error loading class " + name, e);
}
}