Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6331746

javax.management.StandardMBean should not use synchronized(this)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • core-svc
    • None
    • b63
    • generic
    • generic

      Certain visible methods in javax.management.StandardMBean, such as getCachedMBeanInfo, are synchronized. Since one of the ways to use this class is to subclass it, this can lead to unexpected deadlocks if the subclass also has synchronized methods or equivalently uses synchronized(this). In the example we have seen, a subclass has a synchronized method that performs a blocking operation. This operation cannot complete until another thread finishes an activity that requires doing mbeanServer.getMBeanInfo. Since getMBeanInfo on a StandardMBean calls getCachedMBeanInfo, which is synchronized, there is a deadlock.

            sjiang Shanliang Jiang (Inactive)
            emcmanus Eamonn McManus
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: