4 Replies Latest reply on May 21, 2009 3:32 PM by alrubinger

    ManagementObjects not getting Picked up

    alrubinger

      In boot.log of Branch_5_x we can clearly see a bunch of entries like:

      18:02:25,585 DEBUG [AbstractManagedObjectFactory] Null ManagedObject created for: class org.jboss.beans.metadata.plugins.AbstractPropertyMetaData


      ...though in the branch where I'm upgrading the bootstrap impl, I'm not seeing MCServer, ServerInfo, ServerConfig registered anymore. These are MC beans that have the correct @ManagementObject annotations. In fact, the statements like those above have disappeared from the boot.log.

      Anything jump out at you guys that would kill this processing? Some system property not set, some JAR no longer on the CP, something along those lines?

      S,
      ALR


        • 1. Re: ManagementObjects not getting Picked up
          alrubinger

          Also, the *only* related stuff in the boot.log now is:

          [alrubinger@localhost Branch_5_x_BootstrapLegacyRemoval]$ cat build/output/jboss-5.1.0.GA/server/default/log/boot.log |grep "AbstractManagedObjectFactory"
          18:49:38,064 DEBUG [AbstractManagedObjectFactory] Set ICF for: interface org.jboss.beans.metadata.spi.BeanMetaData, to: org.jboss.deployers.plugins.managed.BeanMetaDataICF@7fefa490
          18:49:38,261 DEBUG [AbstractManagedObjectFactory] Set ICF for: class org.jboss.system.metadata.ServiceMetaData, to: org.jboss.system.deployers.managed.ServiceMetaDataICF@288e85b5


          S,
          ALR

          • 2. Re: ManagementObjects not getting Picked up
            starksm64

            Its the org.jboss.system.server.profileservice.ProfileServiceBootstrap that creates these core server managed objects from the MCServer.getDeployments(). That bean is deployed in the bootstrap/profile.xml and relies on the context injection of Bootstrap implementations.

            • 3. Re: ManagementObjects not getting Picked up
              alrubinger

              Hmm, changes I made to the ProfileServiceBootstrap are in changing the type of server used...what do you mean by "relies on the context injection of Bootstrap implementations"?

              Index: /home/alrubinger/business/jboss/wc/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
              ===================================================================
              --- /home/alrubinger/business/jboss/wc/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java (.../home/alrubinger/business/jboss/wc/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java) (working copy)
              +++ /home/alrubinger/business/jboss/wc/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java (.../https://svn.jboss.org/repos/jbossas/branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java) (revision 89258)
              @@ -25,6 +25,7 @@
               import java.lang.annotation.Annotation;
               import java.util.ArrayList;
               import java.util.Collection;
              +import java.util.Collections;
               import java.util.HashMap;
               import java.util.HashSet;
               import java.util.Iterator;
              @@ -35,12 +36,11 @@
              
               import org.jboss.beans.info.spi.BeanInfo;
               import org.jboss.beans.metadata.spi.BeanMetaData;
              -import org.jboss.bootstrap.spi.as.JBossASBootstrap;
              -import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
              -import org.jboss.bootstrap.spi.as.server.JBossASServer;
              -import org.jboss.bootstrap.spi.mc.config.MCServerConfig;
              -import org.jboss.bootstrap.spi.mc.server.MCServer;
              -import org.jboss.bootstrap.spi.server.Server;
              +import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
              +import org.jboss.bootstrap.spi.Bootstrap;
              +import org.jboss.bootstrap.spi.Server;
              +import org.jboss.bootstrap.spi.ServerConfig;
              +import org.jboss.bootstrap.spi.microcontainer.MCServer;
               import org.jboss.dependency.spi.ControllerContext;
               import org.jboss.dependency.spi.ControllerState;
               import org.jboss.deployers.client.spi.IncompleteDeploymentException;
              @@ -67,6 +67,7 @@
               import org.jboss.managed.api.ManagedProperty;
               import org.jboss.managed.api.MutableManagedObject;
               import org.jboss.managed.api.annotation.ManagementComponent;
              +import org.jboss.managed.api.annotation.ManagementConstants;
               import org.jboss.managed.api.annotation.ManagementObject;
               import org.jboss.managed.api.annotation.ViewUse;
               import org.jboss.managed.api.factory.ManagedObjectFactory;
              @@ -75,12 +76,16 @@
               import org.jboss.managed.plugins.ManagedObjectImpl;
               import org.jboss.managed.plugins.ManagedOperationImpl;
               import org.jboss.managed.plugins.ManagedPropertyImpl;
              +import org.jboss.managed.plugins.factory.AbstractManagedObjectFactory;
               import org.jboss.metatype.api.types.ArrayMetaType;
              +import org.jboss.metatype.api.types.CollectionMetaType;
               import org.jboss.metatype.api.types.MetaType;
               import org.jboss.metatype.api.types.SimpleMetaType;
               import org.jboss.metatype.api.values.ArrayValueSupport;
              +import org.jboss.metatype.api.values.CollectionValueSupport;
               import org.jboss.metatype.api.values.EnumValue;
               import org.jboss.metatype.api.values.EnumValueSupport;
              +import org.jboss.metatype.api.values.GenericValue;
               import org.jboss.profileservice.spi.MutableProfile;
               import org.jboss.profileservice.spi.NoSuchProfileException;
               import org.jboss.profileservice.spi.Profile;
              @@ -98,7 +103,7 @@
               * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
               * @version $Revision$
               */
              -public class ProfileServiceBootstrap implements JBossASBootstrap, KernelRegistryPlugin
              +public class ProfileServiceBootstrap implements Bootstrap, KernelRegistryPlugin
               {
               /** The log */
               private static final Logger log = Logger.getLogger(ProfileServiceBootstrap.class);
              @@ -226,7 +231,7 @@
               /**
               *
               */
              - public void start(JBossASServer server)
              + public void start(Server server)
               throws Exception
               {
               shutdown.set(false);
              @@ -246,7 +251,7 @@
              
               // Load the profiles
               if(this.profileKey == null)
              - this.profileKey = new ProfileKey(server.getConfiguration().getServerName());
              + this.profileKey = new ProfileKey(server.getConfig().getServerName());
              
               Map<String, Object> metaData = server.getMetaData();
               ProfileMetaData pmd = (ProfileMetaData) metaData.get(ProfileMetaData.class.getName());
              @@ -293,14 +298,14 @@
               }
               }
              
              - public void prepareShutdown(JBossASServer server)
              + public void prepareShutdown(Server server)
               {
               shutdown.set(true);
               if (mainDeployer != null)
               mainDeployer.prepareShutdown();
               }
              
              - public void shutdown(JBossASServer server)
              + public void shutdown(Server server)
               {
               // Disable hotdeployment scanning
               for(ProfileKey key : profileService.getActiveProfileKeys())
              @@ -557,7 +562,7 @@
               }
               // ServerConfig
               type = new ComponentType("MCBean", "ServerConfig");
              - MCServerConfig config = mcserver.getConfiguration();
              + ServerConfig config = mcserver.getConfig();
               ManagedObject mo = mof.initManagedObject(config, null);
               ManagedComponentImpl configComp = new ManagedComponentImpl(type, firstDeployment, mo);
               firstDeployment.addComponent("ServerConfig", configComp);


              S,
              ALR

              • 4. Re: ManagementObjects not getting Picked up
                alrubinger

                Found my problem:

                if(server instanceof MCServer)


                ...should be "MCBasedServer", my mistake. Thanks for pointing me.

                S,
                ALR