diff --git a/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java b/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java index c1ee14a9cd..5a92e5e5ea 100755 --- a/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java +++ b/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java @@ -1226,12 +1226,15 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon if (er.getException() instanceof JMSException) { throw (JMSException)er.getException(); } else { + JMSException jmsEx = null; try { - throw JMSExceptionSupport.create(er.getException()); + jmsEx = JMSExceptionSupport.create(er.getException()); }catch(Throwable e) { - System.err.println(er.getException()); LOG.error("Caught an exception trying to create a JMSException for " +er.getException(),e); } + if(jmsEx !=null) { + throw jmsEx; + } } } return response;