AMBARI-25639: StackOverflowError appears on MethodArgument*Exception during stomp message handling (#3569)
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/spring/RootStompConfig.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/spring/RootStompConfig.java
index a49df55..ee2d407 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/spring/RootStompConfig.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/spring/RootStompConfig.java
@@ -22,6 +22,7 @@
import javax.servlet.ServletContext;
+import org.apache.ambari.server.AmbariException;
import org.apache.ambari.server.agent.AgentSessionManager;
import org.apache.ambari.server.agent.stomp.AmbariSubscriptionRegistry;
import org.apache.ambari.server.api.AmbariSendToMethodReturnValueHandler;
@@ -116,12 +117,9 @@
@MessageExceptionHandler(Exception.class)
@SendToUser("/")
public ErrorMessage handle(Exception e) {
-
- //LOG.error("Exception caught while processing message: " + e.getMessage(), e);
- return new ErrorMessage(e);
+ LOG.error("Exception caught while processing a message: " + e.getMessage(), e);
+ return new ErrorMessage(new AmbariException(e.getMessage()));
}
-
-
}
}