Examples of FaultException


Examples of org.apache.servicemix.jbi.FaultException

    }
    protected NormalizedMessage extract(MessageExchange me) throws ExecutionException {
        if (me.getStatus() == ExchangeStatus.ERROR) {
            throw new ExecutionException(me.getError());
        } else if (me.getFault() != null) {
            throw new ExecutionException(new FaultException("Fault occured", me, me.getFault()));
        } else {
            return me.getMessage("out");
        }
    }
View Full Code Here

Examples of org.apache.servicemix.jbi.FaultException

    /**
     * A helper method which fails and completes the given exchange with the specified error
     */
    public void fail(MessageExchange exchange, Exception error) throws MessagingException {
        if (error instanceof FaultException) {
            FaultException faultException = (FaultException) error;
            exchange.setFault(faultException.getFault());
        } else {
            exchange.setError(error);
        }
        getDeliveryChannel().send(exchange);
    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.FaultException

                policyHandler.afterInvoke(msg);
            }
            msg.setBody(resp);
        } catch (AxisFault e) {
            if (e.getDetail() != null ) {
                FaultException f = new FaultException(e.getMessage(), e.getDetail(), e);
                f.setFaultName(e.getDetail().getQName());
                msg.setFaultBody(f);
            } else {
                msg.setFaultBody(e);
            }
        } catch (Throwable e) {
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.FaultException

                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);
        }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.FaultException

                if (response != null) {
                    msg.setBody(response);
                    try {
                        if (jmsMsg.getBooleanProperty(JMSBindingConstants.FAULT_PROPERTY)) {
                            FaultException e = new FaultException("remote exception", response);
                            Node om = ((Node)response).getFirstChild();
                            e.setFaultName(new QName(om.getNamespaceURI(), om.getLocalName()));
                            msg.setFaultBody(e);
                        }
                    } catch (JMSException e) {
                        throw new JMSBindingException(e);
                    }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.FaultException

            Object response = responseMessageProcessor.extractPayloadFromJMSMessage(jmsMsg);
            if (response != null ){
                msg.setBody(response);
                try {
                    if (jmsMsg.getBooleanProperty(JMSBindingConstants.FAULT_PROPERTY)) {
                        FaultException e = new FaultException("remote exception", response);
                        Node node = ((Node)response).getFirstChild();
                        e.setFaultName(new QName(node.getNamespaceURI(), node.getLocalName()));
                        msg.setFaultBody(e);
                    }
                } catch (JMSException e) {
                    throw new JMSBindingException(e);
                }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.FaultException

                }
            }
            
        } catch (AxisFault e) {
            if (e.getDetail() != null ) {
                FaultException f = new FaultException(e.getMessage(), e.getDetail(), e);
                f.setFaultName(e.getDetail().getQName());
                msg.setFaultBody(f);
            } else {
                msg.setFaultBody(e);
            }
        } catch (Throwable e) {
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.FaultException

            //
            // 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);
        }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.FaultException

                        ctor = exceptionClass.getConstructor();
                        if (ctor != null) {
                            ex = ctor.newInstance();
                            populateException(ex, faultInfo);
                        } else {
                            ex = new FaultException(message, faultInfo, cause);
                        }
                    }
                }
            }
        }
View Full Code Here

Examples of org.apache.tuscany.sca.interfacedef.util.FaultException

            Object resp = invokeTarget(msg);
          
            msg.setBody(resp);
        } catch (AxisFault e) {
            if (e.getDetail() != null ) {
                FaultException f = new FaultException(e.getMessage(), e.getDetail(), e);
                f.setFaultName(e.getDetail().getQName());
                msg.setFaultBody(f);
            } else {
                msg.setFaultBody(e);
            }
        } catch (Throwable e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.