Index: main/src/bin/run.conf
===================================================================
--- main/src/bin/run.conf	(revision 113628)
+++ main/src/bin/run.conf	(working copy)
@@ -42,7 +42,7 @@
 # Specify options to pass to the Java VM.
 #
 if [ "x$JAVA_OPTS" = "x" ]; then
-   JAVA_OPTS="-Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true"
+   JAVA_OPTS="-Dcom.ibm.lang.management.verbose=true -Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true"
 fi
 ## Specify the Security Manager options
 #JAVA_OPTS="$JAVA_OPTS -Djava.security.manager -Djava.security.policy=$POLICY"
Index: jmx/src/main/org/jboss/mx/server/registry/BasicMBeanRegistry.java
===================================================================
--- jmx/src/main/org/jboss/mx/server/registry/BasicMBeanRegistry.java	(revision 113628)
+++ jmx/src/main/org/jboss/mx/server/registry/BasicMBeanRegistry.java	(working copy)
@@ -60,6 +60,8 @@
 import org.jboss.mx.modelmbean.RequiredModelMBeanInvoker;
 import org.jboss.mx.modelmbean.XMBean;
 import org.jboss.mx.modelmbean.XMBeanConstants;
+import org.jboss.mx.mxbean.MXBeanMetaData;
+import org.jboss.mx.mxbean.MXBeanUtils;
 import org.jboss.mx.server.AbstractMBeanInvoker;
 import org.jboss.mx.server.MBeanInvoker;
 import org.jboss.mx.server.RawDynamicInvoker;
@@ -181,11 +183,10 @@
       boolean invokedPreRegister = false;
       String magicToken          = null;
       MBeanInvoker invoker       = null;
-
+      
       if (object == null)
          throw new RuntimeOperationsException(
                new IllegalArgumentException("Attempting to register null object"));
-
       // get mbean type, dynamic or standard
       MBeanCapability mbcap = MBeanCapability.of(object.getClass());
 
@@ -209,8 +210,15 @@
          {
             if( object instanceof RequiredModelMBean )
                invoker = new RequiredModelMBeanInvoker((DynamicMBean)object);
-            else
+            else if(object instanceof DynamicMBean)
                invoker = new RawDynamicInvoker((DynamicMBean)object);
+            else {
+                //JBPAPP-9809
+                Class mxbeanInterface = MXBeanMetaData.findMXBeanInterface(object.getClass());
+                object = MXBeanUtils.createMXBean(object, mxbeanInterface);
+                invoker= new RawDynamicInvoker((DynamicMBean)object);
+            }
+                
          }
 
          // Perform the pregistration
Index: mbeans/src/main/org/jboss/mx/metadata/MBeanCapability.java
===================================================================
--- mbeans/src/main/org/jboss/mx/metadata/MBeanCapability.java	(revision 113628)
+++ mbeans/src/main/org/jboss/mx/metadata/MBeanCapability.java	(working copy)
@@ -21,7 +21,14 @@
  */
 package org.jboss.mx.metadata;
 
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
 import javax.management.DynamicMBean;
+import javax.management.MXBean;
 import javax.management.NotCompliantMBeanException;
 
 /**
@@ -60,6 +67,9 @@
 
    protected int mbeanType = NOT_AN_MBEAN;
 
+   //inner use, indicates how many MXBean interfaces/@ have been found.
+   private int mxCount;
+   
    private MBeanCapability(int type)
    {
       mbeanType = type;
@@ -72,6 +82,23 @@
 
    public static MBeanCapability of(Class mbeanClass) throws NotCompliantMBeanException
    {
+       MBeanCapability cap = ofMBean(mbeanClass);
+       
+       //if null, check for MXBean, if it there is, return it, else, throw exception
+       if(cap == null){
+           //check for MXBeans
+           cap = ofMXBean(mbeanClass);
+           if(cap != null){
+               return cap;
+           } 
+       } else {
+           return cap;
+       }
+       throw new NotCompliantMBeanException("Class does not expose a management interface: " + mbeanClass.getName());
+   }
+   
+   private static MBeanCapability ofMBean(Class mbeanClass)
+   {
       if (null == mbeanClass)
       {
          throw new IllegalArgumentException("MBean class cannot be null");
@@ -97,9 +124,78 @@
       // If there is an ancestor called SuperClass that is an instance of SuperClassMBean
       Class superClass = mbeanClass.getSuperclass();
       if (superClass != null)
-         return of(superClass);
+         return ofMBean(superClass);
 
-      throw new NotCompliantMBeanException("Class does not expose a management interface: " + mbeanClass.getName());
+      return null;
    }
+   
+   @SuppressWarnings("rawtypes")
+   private static MBeanCapability ofMXBean(Class mbeanClass) throws NotCompliantMBeanException{
+       //this is a bit different, than ofMBean ( I hope ). We need to dive into interfaces.
+       if (null == mbeanClass)
+       {
+          throw new IllegalArgumentException("MBean class cannot be null");
+       }
+       Class workOnMe = mbeanClass;
+       //gather all interfaces(top defined - this could be done with recursion.
+       LinkedList<Class> ifaces = new LinkedList<Class>();
+       while(true){
+           Class[] declaredIfaces = workOnMe.getInterfaces();
+           ifaces.addAll(Arrays.asList(declaredIfaces));
+           workOnMe = workOnMe.getSuperclass();
+           if(workOnMe == null || workOnMe.equals(Object.class))
+               break;
+       }
+       //set, to avoid duplicates
+       Set<Class> score = new HashSet<Class>();
+       for(Class iface:ifaces){
+           ofMXBeanInterface(iface,score);
+       }
+       switch(score.size()){
+           case 0:
+               return null;
+           case 1:
+               //Note ... in perfect world we would return: MX_BEAN defined above..( if it has been defined )
+               //This value will use AS5 mx.mxbean package and classes implemented there.
+               return new MBeanCapability(DYNAMIC_MBEAN);
+           default:
+               throw new NotCompliantMBeanException("Class '"+mbeanClass.getName()+"' exposes more than one MXBean interface '"+score+"'");
+               
+       }
 
-}
+   }
+  
+   @SuppressWarnings("rawtypes")
+   private static void ofMXBeanInterface(Class mbeanInterface, Set<Class> score){
+
+       //we need to check for:
+       // - @MXBean || @MXBean(true)
+       // - zxcMXBean interface
+       //NOTE: there is JBoss AS MXBean annotation, we dont mess with that stuff....
+       //Either annotation or Name - both at the same time are assumed to be valid.
+       MXBean jdkAnnodation = (MXBean) mbeanInterface.getAnnotation(MXBean.class);
+       if(jdkAnnodation!=null && jdkAnnodation.value()){
+          score.add(mbeanInterface);
+           //if annotation is there its ok, else we check interface name
+       } else {
+           //check interface name
+           final String ifaceName = mbeanInterface.getName();
+           if(ifaceName.endsWith("MXBean") && ifaceName.lastIndexOf("MXBean")>0){
+               score.add(mbeanInterface);
+           }
+           
+           
+       }
+       //now we need to check super interfaces
+       //NOTE: there is no word on double def -
+       //@MXBean public interface XX{}
+       //@MXBean public interface YY extends XX{} ... 
+       //so we assume thats a no no. Same for class names?
+       //
+       Class[] ifaces = mbeanInterface.getInterfaces();
+       if(ifaces != null) //just in case some JVMs dont behave here
+           for(Class i:ifaces){
+               ofMXBeanInterface(i,score);
+           }
+   }
+}
\ No newline at end of file
Index: mbeans/src/main/org/jboss/mx/mxbean/MXBeanMetaData.java
===================================================================
--- mbeans/src/main/org/jboss/mx/mxbean/MXBeanMetaData.java	(revision 113628)
+++ mbeans/src/main/org/jboss/mx/mxbean/MXBeanMetaData.java	(working copy)
@@ -33,6 +33,7 @@
 import javax.management.MBeanInfo;
 import javax.management.MBeanNotificationInfo;
 import javax.management.MBeanOperationInfo;
+import javax.management.MXBean;
 import javax.management.NotCompliantMBeanException;
 import javax.management.NotificationBroadcaster;
 import javax.management.openmbean.OpenMBeanAttributeInfo;
@@ -78,9 +79,10 @@
       Class<?> concrete = mbeanClass;
       while (null != concrete)
       {
-         Class result = findMXBeanInterface(concrete, concrete.getInterfaces());
+         Class result = findMXBeanInterface(concrete.getInterfaces());
          if (null != result)
             return result;
+         
          concrete = concrete.getSuperclass();
       }
       return null;
@@ -93,23 +95,27 @@
     * @param interfaces the interfaces to consider
     * @return the interface
     */
-   private static Class<?> findMXBeanInterface(Class<?> concrete, Class<?>[] interfaces)
-   {
-      String mxName = concrete.getName() + "MXBean";
-      String stdName = concrete.getName() + "MBean";
+    private static Class<?> findMXBeanInterface(Class<?>[] interfaces) {
+        //NOTE: returns first encountered result, MBeanCapability.of(...) checks for error conditions.
+        for (Class<?> intf : interfaces) {
+            // JBoss AS annotation
+            MXBean mxBean = intf.getAnnotation(MXBean.class);
+            if (mxBean != null && mxBean.value())
+                return intf;
+            MXBean jdkAnnodation = (MXBean) intf.getAnnotation(MXBean.class);
+            if (jdkAnnodation != null && jdkAnnodation.value()) {
+                return intf;
+                // if annotation is there its ok, else we check interface name
+            }
 
-      for (Class<?> intf : interfaces)
-      {
-         String name = intf.getName();
-         if (mxName.equals(name) || stdName.equals(name))
-            return intf;
-         
-         MXBean mxBean = intf.getAnnotation(MXBean.class);
-         if (mxBean != null && mxBean.value())
-            return intf;
-      }
-      return null;
-   }
+            // check interface name
+            final String ifaceName = intf.getName();
+            if (ifaceName.endsWith("MXBean") && ifaceName.lastIndexOf("MXBean") > 0) {
+                return intf;
+            }
+        }
+        return null;
+    }
 
    /**
     * Create a new MXBeanMetaData.
