In Jmx Client code add notification listener is not working
===

I have server program which sends notification and i have a jmx client code to consume that.In Jmx client code i will connect the bean remotely and try to consume the notification. My Problem is i am sending the notification from server code and i verified in jconsole also. but my client code unable to consume that.


This is the code, i am using. When i run i didnt get notifications. I implemented NotificationListner in my code and also i have handlenotification method.

JMXServiceURL url = new JMXServiceURL(
				"service:jmx:rmi:///jndi/rmi://172.26.2.210:8080/jmxrmi");
		
		System.out.println("2 Url");
		JMXConnector jmxc = JMXConnectorFactory.connect(url, null);

		
		System.out.println("3 Connected");

		
		MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();

		ObjectName on = new ObjectName("Bean:name=XYZ");

		// ObjectName domainRT = (ObjectName) mbsc.getAttribute(on,"");
		System.out.println("4 MBean count = " + mbsc.getMBeanCount());
		Set<ObjectName> names = new TreeSet<ObjectName>(mbsc.queryNames(on,
				null));

		for (ObjectName name : names) {
			System.out.println("\tObjectName = " + name);
			
			mbsc.addNotificationListener(name, this, null, null);		

		}



