- 
        1. Re: jmx-consolepeterj Nov 3, 2006 11:13 AM (in response to editha)When I want to look up an mbean, I usually go through JNDI as follows: Context ctx = new InitialContext(...); MBeanServerConnection mconn = (MBeanServerConnection)ctx.lookup("jmx/invoker/RMIAdaptor"); String mbean = "JMImplementation:service=LoaderRepository"; Object result = mconn.invoke(new ObjectName(mbean), "getLoaders", new Object[]{} ,newString[]{});
- 
        2. Re: jmx-consoleeditha Nov 3, 2006 11:38 AM (in response to editha)Thank you for your answer! 
 I tried to do it your way but it still isn't working. I still get the MBeanException caused by the InstanceNotFoundException..
- 
        3. Re: jmx-consolepeterj Nov 3, 2006 12:28 PM (in response to editha)I went to the jmx-console and noticed that the name you should be looking up is: 
 String mbean = "JMImplementation:name=Default,service=LoaderRepository";
- 
        4. Re: jmx-consoleeditha Nov 4, 2006 10:54 AM (in response to editha)
 Thank you very much!
 I was indeed looking at the wring name.
- 
        5. Re: jmx-consoleeditha Nov 6, 2006 10:30 AM (in response to editha)Now I'm facing another problem: 
 Invoking some methods of the LoaderRepository mbean works, and invoking other methods doesn't work:
 e.g.
 mconn.invoke(new ObjectName(mbean), "getUrls", new Object[]{} ,newString[]{});
 works, whereas
 mconn.invoke(new ObjectName(mbean), "getLoaders", new Object[]{} ,newString[]{});
 throws a ReflectionException caused by an IllegalArgumentException: Unable to find operation getLoaders() in AbstractMBeanInvoker.
 The method getLoaders() doesn't take any arguments, so I do not know why this exception is thrown. Any ideas?
- 
        6. Re: jmx-consolepeterj Nov 6, 2006 10:55 AM (in response to editha)There is no "getLoaders" method, nor is there a "Loaders" property. I do see a getPackageClassLoaders method. 
- 
        7. Re: jmx-consoleeditha Nov 6, 2006 10:59 AM (in response to editha)
 Thank you for your quick answer. Where do you see that? I was looking at the jboss LoaderRepository class...
- 
        8. Re: jmx-consolepeterj Nov 6, 2006 11:00 AM (in response to editha)I ran the jmx-console and looked at the available properties and operations. 
- 
        9. Re: jmx-consoleeditha Nov 6, 2006 11:11 AM (in response to editha)Ah, now I saw it too. thanks again! 
 I thought since since it is an instance of UnifiedLoaderRepository3, I thought it was inheriting the methods of the LoaderRepository class, but it seems I was wrong..
 
    