}
try {
if (objectFactory.isNoArgConstructorRequired()) {
Class clazz = objectFactory.getClassInstance(className);
if (!Modifier.isPublic(clazz.getModifiers())) {
throw new ConfigurationException("Action class [" + className + "] is not public", loc);
}
clazz.getConstructor(new Class[]{});
}
} catch (ClassNotFoundException e) {
if (LOG.isDebugEnabled()) {
LOG.debug("Class not found for action [#0]", e, className);
}
throw new ConfigurationException("Action class [" + className + "] not found", loc);
} catch (NoSuchMethodException e) {
if (LOG.isDebugEnabled()) {
LOG.debug("No constructor found for action [#0]", e, className);
}
throw new ConfigurationException("Action class [" + className + "] does not have a public no-arg constructor", e, loc);
} catch (RuntimeException ex) {
// Probably not a big deal, like request or session-scoped Spring 2 beans that need a real request
if (LOG.isInfoEnabled()) {
LOG.info("Unable to verify action class [#0] exists at initialization", className);
}
if (LOG.isDebugEnabled()) {
LOG.debug("Action verification cause", ex);
}
} catch (Exception ex) {
// Default to failing fast
if (LOG.isDebugEnabled()) {
LOG.debug("Unable to verify action class [#0]", ex, className);
}
throw new ConfigurationException(ex, loc);
}
return true;
}