Author: chirino
Date: Wed Sep 23 15:27:27 2009
New Revision: 818138

URL: http://svn.apache.org/viewvc?rev=818138&view=rev
Log:
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.


Modified:
    
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java

Modified: 
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java
URL: 
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java?rev=818138&r1=818137&r2=818138&view=diff
==============================================================================
--- 
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java
 (original)
+++ 
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportSupport.java
 Wed Sep 23 15:27:27 2009
@@ -93,7 +93,12 @@
      */
     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);
+            }
         }
     }
 


Reply via email to