diff --git a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ObjectMBean.java b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ObjectMBean.java index 712b1a0da45..376ab566f28 100644 --- a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ObjectMBean.java +++ b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ObjectMBean.java @@ -241,7 +241,9 @@ public class ObjectMBean implements DynamicMBean // Find list of classes that can influence the mbean Class o_class=_managed.getClass(); - List> influences = findInfluences(new ArrayList>(), _managed.getClass()); + List> influences = new ArrayList>(); + influences.add(this.getClass()); // always add MBean itself + influences = findInfluences(influences, _managed.getClass()); if (LOG.isDebugEnabled()) LOG.debug("Influence Count: {}", influences.size() ); @@ -560,35 +562,23 @@ public class ObjectMBean implements DynamicMBean private static List> findInfluences(List> influences, Class aClass) { - if (aClass!=null) + if (aClass != null) { - // This class is an influence - influences.add(aClass); - - String pName = aClass.getPackage().getName(); - String cName = aClass.getName().substring(pName.length() + 1); - String mName = pName + ".jmx." + cName + "MBean"; - - try + if (!influences.contains(aClass)) { - Class mbeanClazz = Class.forName(mName); - if (LOG.isDebugEnabled()) - LOG.debug("MBean Influence found for " + aClass.getSimpleName()); - influences.add(mbeanClazz); - } - catch (ClassNotFoundException cnfe) - { - if (LOG.isDebugEnabled()) - LOG.debug("No MBean Influence for " + aClass.getSimpleName()); + // This class is a new influence + influences.add(aClass); } // So are the super classes - influences=findInfluences(influences,aClass.getSuperclass()); + influences = findInfluences(influences,aClass.getSuperclass()); // So are the interfaces Class[] ifs = aClass.getInterfaces(); - for (int i=0;ifs!=null && i(); String[] attributes = managedAttributes.split(","); for (String attribute : attributes) - _managedAttributes.put(attribute,null); + { + _managedAttributes.put(attribute.trim(),null); + } Enumeration e = _scontext.getAttributeNames(); while (e.hasMoreElements()) diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java index 3983543eecf..15bae85ade8 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java @@ -112,6 +112,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL "org.xml.", // needed by javax.xml "org.w3c.", // needed by javax.xml "org.eclipse.jetty.jmx.", // webapp cannot change jmx classes + "org.eclipse.jetty.util.annotation.", // webapp cannot change jmx annotations "org.eclipse.jetty.continuation.", // webapp cannot change continuation classes "org.eclipse.jetty.jndi.", // webapp cannot change naming classes "org.eclipse.jetty.jaas.", // webapp cannot change jaas classes @@ -130,6 +131,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL public final static String[] __dftServerClasses = { "-org.eclipse.jetty.jmx.", // don't hide jmx classes + "-org.eclipse.jetty.util.annotation.", // don't hide jmx annotation "-org.eclipse.jetty.continuation.", // don't hide continuation classes "-org.eclipse.jetty.jndi.", // don't hide naming classes "-org.eclipse.jetty.jaas.", // don't hide jaas classes