List of usage examples for java.lang.reflect UndeclaredThrowableException getUndeclaredThrowable
public Throwable getUndeclaredThrowable()
From source file:org.uddi.v3_service.DispositionReportFaultMessage.java
/** * Convenience method to figure out if the Exception at hand contains a * DispositionReport. Disposition report will be null if none can be found. * //ww w. j av a 2 s .c om * @param e the Exception at hang * @return DispositionReport if one can be found, or null if it is not. */ public static DispositionReport getDispositionReport(Exception e) { DispositionReport report = null; if (e instanceof DispositionReportFaultMessage) { DispositionReportFaultMessage faultMsg = (DispositionReportFaultMessage) e; report = faultMsg.getFaultInfo(); } else if (e instanceof SOAPFaultException) { SOAPFaultException soapFault = (SOAPFaultException) e; Detail detail = soapFault.getFault().getDetail(); if (detail != null && detail.getFirstChild()!=null) { try { report = new DispositionReport(detail.getFirstChild()); } catch (JAXBException je) { log.error("Could not unmarshall detail to a DispositionReport"); } } } else if (e instanceof UndeclaredThrowableException) { UndeclaredThrowableException ute =(UndeclaredThrowableException) e; if (ute.getUndeclaredThrowable()!=null && ute.getUndeclaredThrowable().getCause()!=null && ute.getUndeclaredThrowable().getCause().getCause() instanceof DispositionReportFaultMessage) { DispositionReportFaultMessage faultMsg = (DispositionReportFaultMessage) ute.getUndeclaredThrowable().getCause().getCause(); report = faultMsg.getFaultInfo(); } } else { log.error("Unsupported Exception: " + e.getClass()); } return report; }