return namedClass.newInstance();
} catch (ClassNotFoundException e) {
if (returnNull) {
return null;
}
throw new CannotInstantiateObjectException(
"Unable to resolve factory class: '" + className + "'", e);
} catch (IllegalAccessException e) {
throw new CannotInstantiateObjectException(
"Unable to access factory class: '" + className + "'", e);
} catch (InstantiationException e) {
throw new CannotInstantiateObjectException(
"Unable to instantiate factory class: '"
+ className
+ "'. Make sure that this class has a default constructor",
e);
} finally {