JBoss Enterprise Data Grid
  1. JBoss Enterprise Data Grid
  2. EDG-48

Infinispan MBeans need registering in JBoss MBean Server

    Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: EAP 5.1.0 EDG TP
    • Component/s: Infinispan
    • Security Level: Public (Everyone can see)
    • Labels:
      None
    • Similar Issues:
      Show 9 results 

      Description

      On Mon, 2011-01-24 at 09:54 +0100, Galder Zamarreño wrote:
      On Jan 20, 2011, at 8:55 PM, Richard Achmatowicz wrote:

      Hi Galder

      Run into a couple of problems with the datagrid.sar deployment and JMX:
      1. Infinispan is creating its own MBeanServer to register MBeans in, instead of using the JBoss MBeanServer

      This is configurable via mBeanServerLookup attribute of globalJmxStatistics. By default it uses java.lang.management.ManagementFactory.getPlatformMBeanServer().

      So, maybe it needs to retrieve the JBoss MBeanServer? I've just checked the AS6 configurations and they didn't have to modify this, at least not in XML (not sure if they do something programmatically, maybe Paul/Scott can confirm this):
      https://svn.jboss.org/repos/jbossas/tags/6.0.0.Final/cluster/src/resources/infinispan/infinispan-configs.xml

      To clarify, in AS6, an mbean server lookup is added programatically by
      the CacheContainerFactory. The factory serves a few purposes:

      And here is this object's configuration:
      <bean name="CacheContainerFactory" class="org.jboss.ha.ispn.DefaultCacheContainerFactory">
      <constructor>
      <parameter><inject bean="JChannelFactory"/></parameter>
      <parameter><inject bean="JMXKernel" property="mbeanServer"/></parameter>
      </constructor>
      </bean>

      So, perhaps EDG may want to leverage this? This library
      (ha-server-ispn, has no dependencies other than infinispan)

      So, it would seem like AS6 uses the default platform MBeanServer whereas EAP5 uses the JBoss MBeanServer. IOW, for the datagrid profile, an implementation of org.infinispan.jmx.MBeanServerLookup is needed that does this:

      import org.jboss.mx.util.MBeanServerLocator;

      public class JBossMBeanServerLookup implements MBeanServerLookup {

      public MBeanServer getMBeanServer(Properties properties)

      { return MBeanServerLocator.locateJBoss(); }

      }

      I'm not sure though where we'd put that code... I don't think it you can do it in cluster/ or any of the existing modules cos that would add infinispan as dependency to the default server profiles, which would bring a different JGroups as well, not good. The alternatives are:

      • create a new maven module where you put this code in and make sure it gets shipped with the rest jars
      • or, create a new maven module in infinispan where we add this code and its dependency, and add a dependency for that in EDG.

      The first of the two options is the one that makes more sense since this is integration code and should live in AS/EDG.

      2. DefaltCacheManager.start() seems to get called twice in startup, which causes "Could not register object with name" messages to appear in the console

      Known issue in 4.2.0: https://issues.jboss.org/browse/ISPN-853

      Any ideas? If this is not an quick answer, want me to set up a JIRA?
      Details below.

      I wanted to use JMX to talk to some of the Infinispan MBeans, so I set globalJmxStatistics=true in the global configuration.
      Beacuse the JMX console is not enabled in EDG, I tried to use twiddle to interact with the MBeans but found none:

      ./twiddle.sh -s 192.168.0.100:1099 query ':'
      // no MBeans listed in domain infinispan

      It appears that Infinspan is creating its own MBeanServer when DefaultCacheManager is deployed, and not referencing the existing JBoss MBeanServer.
      Here is some debugging output from the EDG console on startup. I added some logging statements to a few components:

      14:38:32,334 INFO [DefaultCacheManager] start() called (which calls CacheManagerJmxRegistration)
      14:38:32,334 INFO [CacheManagerJmxRegistration] MBean server = org.jboss.mx.server.MBeanServerImpl@21453d72[ defaultDomain='jboss' ]
      14:38:32,336 INFO [CacheManagerJmxRegistration] domains = [Ljava.lang.String;@476127f4
      14:38:32,336 INFO [CacheManagerJmxRegistration] in start()
      14:38:32,425 INFO [ComponentsJmxRegistration] mBeanServer = org.jboss.mx.server.MBeanServerImpl@b354f7e[ defaultDomain='null' ], jmxDomain = infinispan, groupName = type=CacheManager,name="DefaultCacheManager"
      14:38:32,442 INFO [ComponentsJmxRegistration] Trying to register org.infinispan.jmx.ResourceDMBean@4fa6cb2d under infinispan:type=CacheManager,name="DefaultCacheManager",component=CacheManager
      14:38:32,442 INFO [ComponentsJmxRegistration] Pre-existing object names:
      14:38:32,442 INFO [ComponentsJmxRegistration] on = java.lang:type=MemoryPool,name=PS Eden Space
      14:38:32,443 INFO [ComponentsJmxRegistration] on = java.lang:type=Memory
      14:38:32,443 INFO [ComponentsJmxRegistration] on = java.lang:type=MemoryPool,name=PS Survivor Space
      14:38:32,443 INFO [ComponentsJmxRegistration] on = java.lang:type=MemoryPool,name=Code Cache
      14:38:32,443 INFO [ComponentsJmxRegistration] on = java.lang:type=GarbageCollector,name=PS MarkSweep
      14:38:32,443 INFO [ComponentsJmxRegistration] on = java.lang:type=Runtime
      14:38:32,443 INFO [ComponentsJmxRegistration] on = java.lang:type=ClassLoading
      14:38:32,443 INFO [ComponentsJmxRegistration] on = JMImplementation:type=MBeanRegistry
      14:38:32,443 INFO [ComponentsJmxRegistration] on = JMImplementation:service=LoaderRepository,name=Default
      14:38:32,443 INFO [ComponentsJmxRegistration] on = java.lang:type=Threading
      14:38:32,443 INFO [ComponentsJmxRegistration] on = java.util.logging:type=Logging
      14:38:32,443 INFO [ComponentsJmxRegistration] on = java.lang:type=Compilation
      14:38:32,443 INFO [ComponentsJmxRegistration] on = com.sun.management:type=HotSpotDiagnostic
      14:38:32,443 INFO [ComponentsJmxRegistration] on = java.lang:type=MemoryPool,name=PS Perm Gen
      14:38:32,443 INFO [ComponentsJmxRegistration] on = java.lang:type=OperatingSystem
      14:38:32,443 INFO [ComponentsJmxRegistration] on = java.lang:type=GarbageCollector,name=PS Scavenge
      14:38:32,443 INFO [ComponentsJmxRegistration] on = java.lang:type=MemoryPool,name=PS Old Gen
      14:38:32,444 INFO [ComponentsJmxRegistration] on = JMImplementation:type=MBeanServerDelegate
      14:38:32,444 INFO [ComponentsJmxRegistration] on = java.lang:type=MemoryManager,name=CodeCacheManager
      14:38:32,444 INFO [DefaultCacheManager] start() called (which calls CacheManagerJmxRegistration)
      14:38:32,445 INFO [CacheManagerJmxRegistration] MBean server = org.jboss.mx.server.MBeanServerImpl@21453d72[ defaultDomain='jboss' ]
      14:38:32,445 INFO [CacheManagerJmxRegistration] domains = [Ljava.lang.String;@3d1cd90
      14:38:32,445 INFO [CacheManagerJmxRegistration] MBean server = org.jboss.mx.server.MBeanServerImpl@b354f7e[ defaultDomain='null' ]
      14:38:32,445 INFO [CacheManagerJmxRegistration] domains = [Ljava.lang.String;@430eaae5
      14:38:32,445 INFO [CacheManagerJmxRegistration] in start()
      14:38:32,445 INFO [ComponentsJmxRegistration] mBeanServer = org.jboss.mx.server.MBeanServerImpl@b354f7e[ defaultDomain='null' ], jmxDomain = infinispan, groupName = type=CacheManager,name="DefaultCacheManager"
      14:38:32,454 INFO [ComponentsJmxRegistration] Trying to register org.infinispan.jmx.ResourceDMBean@77f5c2c7 under infinispan:type=CacheManager,name="DefaultCacheManager",component=CacheManager
      14:38:32,455 INFO [ComponentsJmxRegistration] Pre-existing object names:
      14:38:32,455 INFO [ComponentsJmxRegistration] on = java.lang:type=MemoryPool,name=PS Eden Space
      14:38:32,455 INFO [ComponentsJmxRegistration] on = java.lang:type=Memory
      14:38:32,455 INFO [ComponentsJmxRegistration] on = java.lang:type=MemoryPool,name=PS Survivor Space
      14:38:32,455 INFO [ComponentsJmxRegistration] on = java.lang:type=MemoryPool,name=Code Cache
      14:38:32,455 INFO [ComponentsJmxRegistration] on = java.lang:type=GarbageCollector,name=PS MarkSweep
      14:38:32,455 INFO [ComponentsJmxRegistration] on = java.lang:type=Runtime
      14:38:32,455 INFO [ComponentsJmxRegistration] on = java.lang:type=ClassLoading
      14:38:32,459 INFO [ComponentsJmxRegistration] on = JMImplementation:type=MBeanRegistry
      14:38:32,459 INFO [ComponentsJmxRegistration] on = JMImplementation:service=LoaderRepository,name=Default
      14:38:32,459 INFO [ComponentsJmxRegistration] on = java.lang:type=Threading
      14:38:32,459 INFO [ComponentsJmxRegistration] on = infinispan:type=CacheManager,name="DefaultCacheManager",component=CacheManager
      14:38:32,459 INFO [ComponentsJmxRegistration] on = java.util.logging:type=Logging
      14:38:32,459 INFO [ComponentsJmxRegistration] on = java.lang:type=Compilation
      14:38:32,460 INFO [ComponentsJmxRegistration] on = com.sun.management:type=HotSpotDiagnostic
      14:38:32,460 INFO [ComponentsJmxRegistration] on = java.lang:type=MemoryPool,name=PS Perm Gen
      14:38:32,460 INFO [ComponentsJmxRegistration] on = java.lang:type=OperatingSystem
      14:38:32,460 INFO [ComponentsJmxRegistration] on = java.lang:type=GarbageCollector,name=PS Scavenge
      14:38:32,460 INFO [ComponentsJmxRegistration] on = java.lang:type=MemoryPool,name=PS Old Gen
      14:38:32,460 INFO [ComponentsJmxRegistration] on = JMImplementation:type=MBeanServerDelegate
      14:38:32,460 INFO [ComponentsJmxRegistration] on = java.lang:type=MemoryManager,name=CodeCacheManager
      14:38:32,460 INFO [ComponentsJmxRegistration] Could not register object with name(ra): infinispan:type=CacheManager,name="DefaultCacheManager",component=CacheManager
      14:38:32,953 INFO [JGroupsTransport] Starting JGroups Channel

      It also seems that DefaultCacheManager.start() is getting called twice, and the first registration of CacheManager succeeds, but the second attempt fails.


      Galder Zamarreño
      Sr. Software Engineer
      Infinispan, JBoss Cache

        Issue Links

          Activity

          Hide
          Galder Zamarreño
          added a comment -

          Personally, I'd leave JMX should be on by default. That way you can quickly glance at stats information.

          JMX is on for Infinispan caches in AS6: http://anonsvn.jboss.org/repos/jbossas/trunk/cluster/src/resources/infinispan/infinispan-configs.xml

          Show
          Galder Zamarreño
          added a comment - Personally, I'd leave JMX should be on by default. That way you can quickly glance at stats information. JMX is on for Infinispan caches in AS6: http://anonsvn.jboss.org/repos/jbossas/trunk/cluster/src/resources/infinispan/infinispan-configs.xml
          Hide
          Richard Achmatowicz
          added a comment -

          OK, i'll set it on by default.

          Show
          Richard Achmatowicz
          added a comment - OK, i'll set it on by default.
          Hide
          Galder Zamarreño
          added a comment -

          Richard, this should be solved by now? Ready to be closed?

          Show
          Galder Zamarreño
          added a comment - Richard, this should be solved by now? Ready to be closed?
          Hide
          Richard Achmatowicz
          added a comment -

          Yes, looks that way. I got swapped out.

          Show
          Richard Achmatowicz
          added a comment - Yes, looks that way. I got swapped out.
          Hide
          RH Bugzilla Integration
          added a comment -

          This issue has been migrated to Bugzilla bug 745844. Please note that this JIRA issue has been closed as part of the migration and therefore you will need to check the Bugzilla issue to find the current status.

          Show
          RH Bugzilla Integration
          added a comment - This issue has been migrated to Bugzilla bug 745844 . Please note that this JIRA issue has been closed as part of the migration and therefore you will need to check the Bugzilla issue to find the current status.

            People

            • Assignee:
              Unassigned
              Reporter:
              Galder Zamarreño
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: