7 Replies Latest reply on May 23, 2002 10:42 AM by juha


    Angela Whelan Newbie

      hi all,
      I have another problem :S

      I am trying to run the ListenerClient example from Chapter 3 of the JBoss JMX book. However, I get the following error :

      javax.management.RuntimeOperationsException: RuntimeException thrown by the invoke method of the Dynamic MBean
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1557)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at imtf.ch.amon.eventtest.ListenerClient.run(ListenerClient.java:53)
      at imtf.ch.amon.eventtest.ListenerClient.main(ListenerClient.java:132)
      Exception in thread "main"

      Does anyone have any ideas ?

        • 1. Re: javax.management.RuntimeOperationsExcept ion

          print out the nested exception (getTargetException() method) usually gives you a better idea what's going on.

          And use JBossMX, I can almost guarantee you will get more informative error messages (and if you don't we'll fix it) ;)

          -- Juha

          • 2. Re: javax.management.RuntimeOperationsExcep t ion
            Angela Whelan Newbie

            hi Juha,
            I changed my code to catch MBeanException and RuntimeMBeanException and I get the same error as before.

            I have just seen that during JBoss startup I get the following error :

            [INFO,Default] java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
            java.net.ConnectException: Connection refused

            This error has only started appearing in the JBoss startup since I put the BroadCastingUser.java MBean from Chapter 3 of the JMX book into JBoss.

            Now I wonder what is causing this error during JBoss startup and also I wonder is the error message that I get while running the ListenerClient class linked to the error during startup ???

            I have another question, how do I use JBossMX ? I am using version 2.4.4 of JBoss, but I don't know how to integrate the JBossMX module ? I have looked in the JMX book and on the JBoss website, I've downloaded JBossMX1.0 but don't know how to integrate it :S

            Please help !


            • 3. Re: javax.management.RuntimeOperationsExcep t ion
              Adrian Brock Master

              JBoss2.4 won't run with JBossMX becuase of
              the invoke on an attribute error.


              • 4. Re: javax.management.RuntimeOperationsExcep t ion

                yes, you need to update to 3.0 if you want to use JBossMX with the JBoss server.

                As for the exception handling I meant:

                catch (RuntimeOperationsException e)
                 Exception nested = e.getTargetException();

                ... etc. to get the information of the exception the RuntimeOperationsException or MBeanException is wrapping inside itself. The nested exceptions usually provide a more detailed error messages of what is going wrong (and sometimes you will need to unwrap more than one exception too, it's unfortunate).

                -- Juha

                • 5. Re: javax.management.RuntimeOperationsExcep t ion
                  Angela Whelan Newbie

                  I inserted that catch code you suggested Juha, and here's the error I got :

                  java.lang.UnsupportedOperationException: unknown operation remove
                  at imtf.ch.amon.eventtest.DynamicUser.invoke(DynamicUser.java:178)
                  at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
                  at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                  at imtf.ch.amon.eventtest.ListenerClient.run(ListenerClient.java:52)java.lang.UnsupportedOperationException: unknown operation remove

                  at imtf.ch.amon.eventtest.ListenerClient.main(ListenerClient.java:138)

                  I have also upgraded to version 3.0.0 of JBoss, I would like to know how to integrate JBossMX into it, is there information on the web that shows how to do that ? or if someone would provide a bit of help, that would be great.

                  So, I don't know what's causing the error above, it would seem that it can't find the 'remove' method, but why ? I don't understand :(

                  Any ideas/comments/suggestions are very welcome,
                  Thanks very much,

                  • 6. Re: javax.management.RuntimeOperationsExcep t ion
                    Angela Whelan Newbie

                    hi Juha,
                    The code in the book is not doing what the text in the book is saying !

                    The text in the book says :
                    'after registering the MBeans and adding listeners to them, it invokes the remove() method of the BroadcastingUser objects that will cause a notification ot be received in the listeners.' chapter 3, page 61 of the JBoss JMX book

                    So, I changed the code on line 35,36,37 of the JBoss book
                    from :
                    server.registerMBean(new DynamicUser(), john);
                    to :
                    server.registerMBean(new BroadcastingUser(), john);

                    and now the ListenerClient works as the text in the book says, it prints out :

                    User's name has been changed.
                    New value=John
                    User's name has been changed.
                    New value=Mike
                    User's name has been changed.
                    New value=Xena
                    User John removed.
                    user:name=John unregistered.
                    User Mike removed.
                    user:name=Mike unregistered.
                    User Xena removed.
                    user:name=Xena unregistered.

                    Looks like an error in the book :S

                    • 7. Re: javax.management.RuntimeOperationsExcep t ion


                      sounds like there might be an error in the book (I haven't checked yet, will do), ie. the Broadcasting user exposes a remove() management operation as part of its management interface whereas the DynamicUser does not.

                      This explains the error you see in the exception stack trace: unknown operation 'remove'.

                      I will check the text and code later. Thank you for reporting this.

                      As for JBoss 3.0 and JBossMX -- you don't have to do anything, JBossMX is already integrated into the JBoss server from 3.0 version onwards.

                      -- Juha