views:

34

answers:

1

Hi,

I have a client that registers with JMX for notifications. Whenever that JMX Notifications Emitting application is restarted I get an exception

01/08/2010 16:28:04 com.sun.jmx.remote.ws.client.JMXWSManStub fetchNotifications
WARNING: Exception java.io.IOException: java.net.ConnectException: Connection refused: connectoccured during fetch. Closing connection

And stop getting notifications (Obviously).

I would like to be able to catch this exception so I can start a thread that will poll on the target application until it's back up and then I would like to re-register with the events.

My question is - How can I handle this exception myself? Currently the JMX Platform catches it and I'm not sure If I can take over handling it myself.

Thanks for the help!

A: 

Well.. Since no one answered...

My solution was to do polling on the server by removing and re-adding notifications every few seconds. It's not perfect but there is really no way (That I could find) to 'ask' if a notification is still listening.

Ben