Where is this code running?
And I presume that the line number of the IndexOutOfBoundsException is the MBeanServer server = (MBeanServer) servers.get(0); line?
Not used any of the Java Messaging stuff, but shouldn't the domain name of your MBean you're calling be 'jboss.mq' and not just 'jboss'?
Your right, in both cases.
My final achieve was to write my own MBean to create Queues, but if I try to invoke my 'createNewQueue'-method from the jmx console, I get the error:
HTTP ERROR: 500 Failed to invoke operation
So I tried to run my method in a standalone client, so I cannot find an MBean server, clear...
But whats wrong with my MBean?
Finally I managed it, it works!
I simply tried to invoke the wrong method 'destroyQueue' instead of 'createQueue'...
I confused myself with a lot of different test ;-)
Thanks for your help!