From 5efe421cdc5b1e955c964edbdf325e816d6473c0 Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Wed, 23 Sep 2009 15:27:27 +0000 Subject: [PATCH] It's possible that an transport listener could generate a runtime exception while handling an exception. Add a handler for it so that we DEBUG log the event instead of letting it propagate up which eventally kills the run thread and causes a System.err stack dump. git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@818138 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/transport/TransportSupport.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java b/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java index 13876047bf..21d65e2238 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java @@ -93,7 +93,12 @@ public abstract class TransportSupport extends ServiceSupport implements Transpo */ public void onException(IOException e) { if (transportListener != null) { - transportListener.onException(e); + try { + transportListener.onException(e); + } catch (RuntimeException e2) { + // Handle any unexpected runtime exceptions by debug logging them. + LOG.debug("Unexpected runtime exception: "+e2, e2); + } } }