Constructor<?> constructor =
exceptionClass.getConstructor(new Class[] {String.class, faultBeanClass, Throwable.class});
exc = (Exception)constructor.newInstance(new Object[] {message, faultInfo, cause});
} catch (NoSuchMethodException e) {
// Create a generic fault exception
exc = new FaultException(message, faultInfo, cause);
}
// Include the elem name into the FaultException we build so it can be used for matching in the DataTransformationInterceptor
//
// Note this may happen even if we find a constructor above, that is the type of the non-generic fault exc may be an instance
// of FaultException
//
if ((exc instanceof FaultException) && (faultBeanType.getLogical() instanceof XMLType)) {
FaultException faultExc = (FaultException)exc;
DataType<XMLType> faultBeanXMLType = (DataType<XMLType>)faultBeanType;
XMLType faultLogical = faultBeanXMLType.getLogical();
faultExc.setFaultName(faultLogical.getElementName());
}
return exc;
} catch (Throwable e) {
throw new IllegalArgumentException(e);
}