} catch (ClassNotFoundException e) {
try {
// try to load factory from container classloader
impl = Class.forName(factoryName);
} catch (ClassNotFoundException e1) {
throw new InvalidPropertyFactoryException(factoryName, e);
}
}
try {
return (StAXPropertyFactory<?>) impl.newInstance();
} catch (InstantiationException e) {
throw new InvalidPropertyFactoryException(factoryName, e);
} catch (IllegalAccessException e) {
throw new InvalidPropertyFactoryException(factoryName, e);
} catch (ClassCastException e) {
throw new InvalidPropertyFactoryException(factoryName, e);
}
}