diff --git a/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java b/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java index 860ef2ad59..6d490034d0 100644 --- a/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java +++ b/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java @@ -22,6 +22,7 @@ import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.Lifecycle; import org.springframework.integration.core.MessageChannel; +import org.springframework.integration.core.MessagingException; import org.springframework.integration.gateway.SimpleMessagingGateway; import org.springframework.integration.scheduling.TaskScheduler; import org.springframework.oxm.Marshaller; @@ -113,8 +114,7 @@ public class MarshallingWebServiceInboundGateway extends AbstractMarshallingPayl return this.gatewayDelegate.sendAndReceive(requestObject); } catch (Exception e) { - while (e.getClass().getName().startsWith("org.springframework") && - e.getCause() instanceof Exception) { + while (e instanceof MessagingException && e.getCause() instanceof Exception) { e = (Exception) e.getCause(); } throw e; diff --git a/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceInboundGateway.java b/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceInboundGateway.java index 362cbdcb3a..ba336b2707 100644 --- a/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceInboundGateway.java +++ b/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/SimpleWebServiceInboundGateway.java @@ -27,6 +27,7 @@ import javax.xml.transform.dom.DOMSource; import org.w3c.dom.Document; import org.springframework.integration.core.Message; +import org.springframework.integration.core.MessagingException; import org.springframework.integration.gateway.SimpleMessagingGateway; import org.springframework.integration.message.MessageBuilder; import org.springframework.util.Assert; @@ -59,8 +60,7 @@ public class SimpleWebServiceInboundGateway extends SimpleMessagingGateway imple this.doInvoke(messageContext); } catch (Exception e) { - while (e.getClass().getName().startsWith("org.springframework") && - e.getCause() instanceof Exception) { + while (e instanceof MessagingException && e.getCause() instanceof Exception) { e = (Exception) e.getCause(); } throw e;