User: juhalindfors Date: 02/04/08 17:08:32 Modified: src/main/org/jboss/mx/server MBeanServerImpl.java Log: if loadername is null, skip registry.get() (that would throw an instancenotfoundexception) Revision Changes Path 1.21 +8 -2 jmx/src/main/org/jboss/mx/server/MBeanServerImpl.java Index: MBeanServerImpl.java =================================================================== RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/server/MBeanServerImpl.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- MBeanServerImpl.java 1 Mar 2002 19:25:57 -0000 1.20 +++ MBeanServerImpl.java 9 Apr 2002 00:08:32 -0000 1.21 @@ -91,7 +91,7 @@ * @author <a href="mailto:[EMAIL PROTECTED]">Juha Lindfors</a>. * @author <a href="mailto:[EMAIL PROTECTED]">Trevor Squires</a>. * @author <a href="mailto:[EMAIL PROTECTED]">Adrian Brock</a>. - * @version $Revision: 1.20 $ + * @version $Revision: 1.21 $ */ public class MBeanServerImpl implements MBeanServer, ServerConstants @@ -205,14 +205,20 @@ public Object instantiate(String className, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, MBeanException, InstanceNotFoundException { ClassLoader cl = null; + + // if instantiate() is called with null loader name, we use the cl that + // loaded the MBean server (see javadoc) + try { - cl = (ClassLoader)registry.get(loaderName).getResourceInstance(); + if (loaderName != null) + cl = (ClassLoader)registry.get(loaderName).getResourceInstance(); } catch (ClassCastException e) { throw new ReflectionException(e, loaderName + " is not a class loader."); } + if (cl == null) cl = this.getClass().getClassLoader();
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development Sponsored by http://www.ThinkGeek.com/