Uploaded image for project: 'ServiceMix'
  1. ServiceMix
  2. SM-883

MBean registration in Websphere returns different objectName

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 3.0.1, 3.1
    • None
    • servicemix-core
    • None
    • Windows XP SP1, Ubuntu Linux, Java 1.5

    Description

      Description courtesy of David Potter:

      When running serviceMix V3.0 on WebSphere 6.1.0.0 I get the following error
      after stopping and starting serviceMix from the WebSphere console.

      ERROR - ContextLoader - Context initialization failed
      org.springframework.beans.factory.BeanCreationException: Error creating bean
      with name 'jbi' defined in ServletContext resource
      [/WEB-INF/servicemix.xml]: Invocation of init method failed;
      nested exception is
      javax.jbi.JBIException: javax.management.InstanceAlreadyExistsException:
      org.apache.servicemix:Name=ManagementContext,cell=SD1464Node01Cell,Type=SystemService,ContainerName=ServiceMix,node=SD1464Node01,process=server1

      I have traced the error to the fact that when you register an mbean IBM adds
      additional information to the bean. So when serviceMix regesters the bean
      org.apache.servicemix:Name=ManagementContext,Type=SystemService,ContainerName=ServiceMix
      IBM, in the method
      com.ibm.ws.management.PlatformMBeanServer.registerMBean(PlatformMBeanServer.java:469)
      , adds the attributes cell=SD1464Node01Cell,
      node=SD1464Node01,process=server1

      These means that when we try to unregister the bean on application shutdown
      we cannot find it (as we look the been up by name).

      Solution Ideas:

      1) In AsyncBaseLifeCycle.doInit() use queryNames() instead of isRegistered().
      Care would need to be taken in unregistering the bean is case the bean is
      not ours.

      2) After a bean is registered, update its name (or the complete bean) with the
      name of the bean returned by the register operation. (this is preferred)

      Attachments

        1. PatchTo3.0.1.zip
          10 kB
          David Potter
        2. PatchToCurrentVersion.zip
          11 kB
          David Potter
        3. SM-883-MBeanRegistration.patch
          6 kB
          David Potter

        Activity

          People

            grantm Grant Mcdonald
            grantm Grant Mcdonald
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified