activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From miniman <benjamin.cuthb...@db.com>
Subject catching exceptions on login
Date Tue, 06 Feb 2007 13:15:12 GMT

All if i have a client which i want to catch an exception is the client is
unable to connect. So if the activemq is down i still want the client to
work but just display a message that the host is down.

When i try 

 // Create a Connection
              Connection connection = connectionFactory.createConnection();
              connection.setExceptionListener(this);

I get the exception but it does not come from my class

Caught: javax.jms.JMSException: Could not connect to broker URL:
tcp://localhost:61616. Reason: java.net.ConnectException: Connection
refused: connectjavax.jms.JMSException: Could not connect to broker URL:
tcp://localhost:61616. Reason: java.net.ConnectException: Connection
refused: connect
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:33)
	at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:271)
	at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:211)
	at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:158)
	at
com.db.abmonitor.client.dataimporter.TopicConsumer.run(TopicConsumer.java:40)

My method is

      public synchronized void onException(JMSException ex) {
          System.out.println("JMS Exception occured.  Shutting down
client.");
      }
-- 
View this message in context: http://www.nabble.com/catching-exceptions-on-login-tf3180552.html#a8825721
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message