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

NoClassDefFoundError thrown by ManagementFactory.getPlatformMBeanServer

    Details

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.9.0-ea"
        Java(TM) SE Runtime Environment (build 1.9.0-ea-b82)
        Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b82, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Windows 7 64-Bit

        A DESCRIPTION OF THE PROBLEM :
        This is an upstream bug report from JOSM for:
        https://josm.openstreetmap.de/ticket/11577

        We have found with early access builds of JDK9 an error when calling java.lang.management.ManagementFactory.getPlatformMBeanServer().

        It sometimes results in a java.lang.NoClassDefFoundError: com/sun/management/internal/GarbageCollectorExtImpl

        It is reproducible with build b68 and b82 on Windows 7. It seems to only occur on first invocation of the method. Further invocations do not have this error.

        REGRESSION. Last worked in version 8u60

        ADDITIONAL REGRESSION INFORMATION:
        java version "1.8.0_60"
        Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
        Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Call java.lang.management.ManagementFactory.getPlatformMBeanServer()

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        no error
        ACTUAL -
        java.lang.NoClassDefFoundError: com/sun/management/internal/GarbageCollectorExtImpl

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        java.lang.NoClassDefFoundError: com/sun/management/internal/GarbageCollectorExtImpl
        at sun.management.MemoryImpl.getMemoryManagers0(Native Method)
        at sun.management.MemoryImpl.getMemoryManagers(MemoryImpl.java:98)
        at sun.management.ManagementFactoryHelper.getGarbageCollectorMXBeans(ManagementFactoryHelper.java:130)
        at java.lang.management.DefaultPlatformMBeanProvider$4.nameToMBeanMap(DefaultPlatformMBeanProvider.java:185)
        at java.lang.management.ManagementFactory.lambda$getPlatformMBeanServer$0(ManagementFactory.java:478)
        at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:269)
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
        at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1664)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:430)
        at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:479)
        at org.apache.commons.jcs.engine.control.CompositeCacheManager.initialize(CompositeCacheManager.java:262)
        at org.apache.commons.jcs.engine.control.CompositeCacheManager.getUnconfiguredInstance(CompositeCacheManager.java:214)
        at org.openstreetmap.josm.data.cache.JCSCacheManager.initialize(JCSCacheManager.java:117)

        REPRODUCIBILITY :
        This bug can be reproduced often.

        ---------- BEGIN SOURCE ----------
        import java.lang.management.ManagementFactory;
        import javax.management.MBeanServer;

        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
        ---------- END SOURCE ----------

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jbachorik Jaroslav BachorĂ­k
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: