Code example for InvocationTargetException

Methods: getCause

0
 
    private static Log log = LogFactory.getLog(ModuleAdminMessageReceiver.class);
 
    protected void handleInvocationTargetException(InvocationTargetException e, Method method) throws AxisFault {
        String msg = null;
        Throwable cause = e.getCause();
        if (cause != null) {
            msg = cause.getMessage();
        } 
        if (msg == null) {
            msg = "Exception occurred while trying to invoke service method " +
                    (method != null ? method.getName() : "null");
        } 
        if (cause instanceof ModuleMgtException) {
            log.debug(msg, cause);
            AxisFault axisFault = new AxisFault(msg, e);
            axisFault.setDetail(getExceptionDetails((ModuleMgtException)cause));
            throw axisFault;
        } else if (cause instanceof AxisFault) {
            log.debug(msg, cause);
            throw (AxisFault) cause;
        } 
        log.error(msg, e);
        throw new AxisFault(msg, e);
    } 
 
    private OMElement getExceptionDetails(ModuleMgtException e) {
 
        OMFactory factory = OMAbstractFactory.getOMFactory();