returnObject = clazz.newInstance();
}
}
} catch (ClassNotFoundException cnfe) {
throw new ConfigurationException(
buildMessage(MessageFormat.format("Unable to find class ''{0}''",
className)));
} catch (NoClassDefFoundError ncdfe) {
throw new ConfigurationException(
buildMessage(MessageFormat.format("Class ''{0}'' is missing a runtime dependency: {1}",
className,
ncdfe.toString())));
} catch (ClassCastException cce) {
throw new ConfigurationException(
buildMessage(MessageFormat.format("Class ''{0}'' is not an instance of ''{1}''",
className,
rootType)));
} catch (Exception e) {
throw new ConfigurationException(
buildMessage(MessageFormat.format("Unable to create a new instance of ''{0}'': {1}",
className,
e.toString())), e);
}
}