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();