diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java index 24f709fbf4..de5b7eb6de 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java @@ -315,8 +315,10 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint implements Trackab throw t; } } - if ((t instanceof RuntimeException) && - !(t instanceof MessagingException) && !(t instanceof UndeclaredThrowableException)) { + if (t instanceof RuntimeException + && !(t instanceof MessagingException) + && !(t instanceof UndeclaredThrowableException) + && !(t instanceof IllegalStateException && ("Unexpected exception thrown").equals(t.getMessage()))) { throw t; } t = t.getCause();