geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Bartel <>
Subject [jmx] Duplicate notifications
Date Sun, 09 Nov 2003 08:43:23 GMT
I've been testing hot deploying and undeploying Geronimo services and 
something odd is going on. I've spent most of the weekend looking at 
this and not getting any further, so any JMX/MX4J experts out there feel 
free to respond :-)

Essentially, the situation is this:
  + in the preRegister() method for an AbstractManagedObject, the object
    signs itself up to listen for MBean registration notifications
    from the mbean "JMImplementation:type=MBeanServerDelegate"

  + whenever it receives an mbean registration notification, it
    automatically adds itself as a listener for futher event types

  + when an AbstractManagedObject is registered, it seems to receive
    registration notifications for itself, so these are ignored

Now, if I undeploy the service, then the mbean for the service is 
unregistered as expected. But, when I re-deploy the service, not only 
does the AbstractManagedObject receive registration events for itself as 
before, but it receives duplicates of them like this:

     [java] Creating MBean=blah:role=Blah
     [java] -400856369:::: Received registration notification for 
     [java] 18:41:11,646 DEBUG [Blah] blah:role=Blah Notified of my own 
     [java] 18:41:11,646 DEBUG [InterceptorRegistryRouter] Adding 
notificationlistener for blah:role=Blah from 
     [java] -400856369:::: Received registration notification for 
     [java] 18:41:11,952 DEBUG [Blah] blah:role=Blah Notified of my own 
     [java] Registered MBean=blah:role=Blah

I initially thought the duplicates might be due to the 
AbstractManagedObject not explicitly removing itself from the mbean 
server as a notification listener when it is destroyed, so I tried 
adding a removeNotificationListener() call in the 
AbstractManagedObject's preDeregister() method, but that always throws 
an exception like so:
     [java] 19:36:17,868 ERROR [Blah] NotificationListener 

not found

The truly freaky thing is that once any service has been thru the 
deploy/undeploy/redeploy cycle, any OTHER service that is subsequently 
deployed also receives duplicate notifications, even if it has never 
previously been deployed!!!

I've attached some very simple classes and a service file that can be 
dropped into the deploy/jetty directory that illustrates the problem.

Any help gratefully received.


View raw message