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 cd767157a0..85fb2daa44 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 @@ -21,7 +21,9 @@ import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.Lifecycle; +import org.springframework.expression.ExpressionException; import org.springframework.integration.core.MessageChannel; +import org.springframework.integration.core.MessagingException; import org.springframework.integration.gateway.SimpleMessagingGateway; import org.springframework.scheduling.TaskScheduler; import org.springframework.oxm.Marshaller; @@ -113,7 +115,7 @@ public class MarshallingWebServiceInboundGateway extends AbstractMarshallingPayl return this.gatewayDelegate.sendAndReceive(requestObject); } catch (Exception e) { - while (e.getClass().getName().startsWith("org.springframework") && + while ((e instanceof MessagingException || e instanceof ExpressionException) && e.getCause() instanceof Exception) { e = (Exception) e.getCause(); } 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..289343637f 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 @@ -26,7 +26,9 @@ import javax.xml.transform.dom.DOMSource; import org.w3c.dom.Document; +import org.springframework.expression.ExpressionException; 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,7 +61,7 @@ public class SimpleWebServiceInboundGateway extends SimpleMessagingGateway imple this.doInvoke(messageContext); } catch (Exception e) { - while (e.getClass().getName().startsWith("org.springframework") && + while ((e instanceof MessagingException || e instanceof ExpressionException) && e.getCause() instanceof Exception) { e = (Exception) e.getCause(); }