5 Replies Latest reply on Mar 14, 2002 7:30 AM by Susan

    Attribute changing on ModelMBean through MBeanView ("8080")

    Susan Newbie

      Hi,

      After reading the new JMX Book (it is a very very good book of JMX!!!) I wanted to make a class manageable through a ModelMBean.

      So everything works fine, I got all attributes and operations, that should be managed, in the ModelMBean View (HTTP-Adapter 8080).

      Now I want to change the value of an attribute in the ModelMBean View, but then nothing works. CPU used 100%, deadlock...

      So I tried to change the attribute of the modelmbean (representing the class attribute) with "server.setAttribute" and everything works fine...

      so my question: why does the attribute changing not work in the MBeanView (localhost:8080) ???

      Thank you!
      Susan

        • 1. Re: Attribute changing on ModelMBean through MBeanView ("808
          Susan Newbie

          Sorry, port number is 8082 not 8080!

          • 2. Re: Attribute changing on ModelMBean through MBeanView ("808
            Juha Lindfors Master

            That's a bug in Sun's reference implementation. Hopefully it will be fixed with the upcoming maintenance release. In the meantime you can try other HTTP adaptors, for example the one that comes with the Tivoli JMX implementation.

            Hope this helps,

            -- Juha

            • 3. Re: Attribute changing on ModelMBean through MBeanView ("808
              Susan Newbie

              Thanks a lot, Juha!!

              With the Tivoli Adaptor it does work! (even though on the html-side of the Tivoli Adaptor is standing "Internal Server Error - Unable to set the Attribute value". The Attribute value changed really correctly!)

              The Tivoli Adaptor shows (additionally to SUNs adaptor), what NotificationListener is registered on what Broadcasting MBean. A litte time ago, I tried to find a way to find out what Listener is registered on what Broadcaster. How does it work??

              Thank you in advance!
              Susan

              • 4. Re: Attribute changing on ModelMBean through MBeanView ("808
                Juha Lindfors Master


                > The Tivoli Adaptor shows (additionally to SUNs
                > adaptor), what NotificationListener is registered on
                > what Broadcasting MBean. A litte time ago, I tried to
                > find a way to find out what Listener is registered on
                > what Broadcaster. How does it work??

                Hmm, I'm not sure about this. It's not immediately apparent to me how to get this using the standard JMX interfaces, unless you decide to expose your beans listener list as part of the management interface.

                I'll have to look into Tivoli adaptor to see what you mean... so do I understand correctly that if I have an MBean A registered as a listener to MBean B then the HTML view for the MBean B shows that MBean A has been registered to listen to its notifications?

                -- Juha

                • 5. Re: Attribute changing on ModelMBean through MBeanView ("808
                  Susan Newbie

                  In the HTML-View of the Tivoli Adaptor (on a page to remove a NotificationListener) there are two listings. In one you can find all MBeans that act as a NotificationListener and the other listing shows, which MBeans act as NotificationBroadcaster.

                  I'm not sure, how to find this out. Maybe with a look in the MBean's Sourcecode... or something else??

                  I think, it could be important to know, which NotificationListener is registered on what NotificationBroadcaster.
                  So if I do "addNotificationListener", and the NotificationListener is already registered on the NotificationBroadcaster, I'm not getting any exception. But I didn't find a way, to find out, "who is registered on whom"...
                  (expecting to do a check with "removeNotificationListener", because there will be thrown "InstanceNotFoundException" and "ListenerNotFoundException").

                  It would be nice to know, if there is a way, to find out: "who is registered on whom"...

                  Many Thanks in Advance!!!
                  Susan