From 08bfa9ab65f9f3779abcd2a3393ee9cc3ec73833 Mon Sep 17 00:00:00 2001 From: Victor Verbitsky Date: Fri, 11 Jul 2014 11:40:01 +0400 Subject: [PATCH] Fix exceptions handling in SCA. Otherwise many exceptions may be suppressed. --- .../component/sca/SwitchYardRemotingServlet.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sca/src/main/java/org/switchyard/component/sca/SwitchYardRemotingServlet.java b/sca/src/main/java/org/switchyard/component/sca/SwitchYardRemotingServlet.java index f6e057c60..2877dd542 100644 --- a/sca/src/main/java/org/switchyard/component/sca/SwitchYardRemotingServlet.java +++ b/sca/src/main/java/org/switchyard/component/sca/SwitchYardRemotingServlet.java @@ -134,6 +134,16 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr reply.setContent(syEx); _serializer.serialize(reply, RemoteMessage.class, response.getOutputStream()); response.getOutputStream().flush(); + } catch (Exception ex) { + if (_log.isDebugEnabled()) { + _log.debug("Failed to process remote invocation", ex); + } + + RemoteMessage reply = new RemoteMessage(); + reply.setFault(true); + reply.setContent(new SwitchYardException(ex)); + _serializer.serialize(reply, RemoteMessage.class, response.getOutputStream()); + response.getOutputStream().flush(); } finally { if (transactionPropagated) { bridgeOutgoingTransaction();