diff options
Diffstat (limited to 'branches/sca-java-1.4/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms')
2 files changed, 11 insertions, 2 deletions
diff --git a/branches/sca-java-1.4/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java b/branches/sca-java-1.4/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java index 2fcb07a07f..e229cc9043 100644 --- a/branches/sca-java-1.4/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java +++ b/branches/sca-java-1.4/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java @@ -18,6 +18,8 @@ */ package org.apache.tuscany.sca.binding.jms.provider; +import java.lang.reflect.InvocationTargetException; + import javax.jms.JMSException; import javax.jms.Message; import javax.jms.ObjectMessage; @@ -101,7 +103,11 @@ public abstract class AbstractMessageProcessor implements JMSMessageProcessor { try { ObjectMessage message = session.createObjectMessage(); - message.setObject(o); + if (o instanceof ServiceRuntimeException && ((ServiceRuntimeException)o).getCause() instanceof InvocationTargetException) { + message.setObject(o.getCause() ); + } else { + message.setObject(o); + } message.setBooleanProperty(JMSBindingConstants.FAULT_PROPERTY, true); return message; diff --git a/branches/sca-java-1.4/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java b/branches/sca-java-1.4/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java index 96d6ab7c46..a4cc79426e 100644 --- a/branches/sca-java-1.4/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java +++ b/branches/sca-java-1.4/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java @@ -30,6 +30,7 @@ import org.apache.tuscany.sca.binding.jms.impl.JMSBinding; import org.apache.tuscany.sca.binding.jms.impl.JMSBindingConstants; import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException; import org.apache.tuscany.sca.interfacedef.Operation; +import org.apache.tuscany.sca.interfacedef.util.FaultException; import org.apache.tuscany.sca.invocation.DataExchangeSemantics; import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.runtime.RuntimeComponentReference; @@ -204,8 +205,10 @@ public class RRBJMSBindingInvoker implements Invoker, DataExchangeSemantics { if ((e.getCause().getCause() instanceof RuntimeException)) { tuscanyMsg.setFaultBody(e.getCause()); } else { - tuscanyMsg.setFaultBody(e.getCause().getCause()); + tuscanyMsg.setFaultBody(((InvocationTargetException)e.getCause()).getTargetException()); } + } else if (e.getCause() instanceof FaultException) { + tuscanyMsg.setFaultBody(e.getCause()); } else { tuscanyMsg.setFaultBody(e); } |