-
1. Re: javax.management.RuntimeOperationsExcept ion
juha May 22, 2002 6:18 PM (in response to angelawhelan)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
angelawhelan May 23, 2002 4:50 AM (in response to angelawhelan)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 !
Thanks,
A. -
3. Re: javax.management.RuntimeOperationsExcep t ion
adrian.brock May 23, 2002 5:18 AM (in response to angelawhelan)JBoss2.4 won't run with JBossMX becuase of
the invoke on an attribute error.
Regards,
Adrian -
4. Re: javax.management.RuntimeOperationsExcep t ion
juha May 23, 2002 5:44 AM (in response to angelawhelan)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(); nested.printStackTrace(); System.out.println(nested); }
... 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
angelawhelan May 23, 2002 6:11 AM (in response to angelawhelan)hi,
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,
A. -
6. Re: javax.management.RuntimeOperationsExcep t ion
angelawhelan May 23, 2002 6:38 AM (in response to angelawhelan)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
juha May 23, 2002 10:42 AM (in response to angelawhelan)Angela,
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