java.lang.ClassCastException: [Ljavax.management.openmbean.CompositeData; cannot be cast to javax.management.openmbean.CompositeData

Coderanch | Peter van Nes | 2 years ago
  1. 0

    How to return non openType in MXBean

    Coderanch | 2 years ago | Peter van Nes
    java.lang.ClassCastException: [Ljavax.management.openmbean.CompositeData; cannot be cast to javax.management.openmbean.CompositeData
  2. 0

    Jetty JMX Webservice – Webtide

    webtide.com | 4 months ago
    java.lang.ClassCastException: java.lang.String cannot be cast to javax.management.openmbean.CompositeData
  3. 0

    Cannot get high availability info via proxy mbean

    GitHub | 3 years ago | wouterv
    java.lang.ClassCastException: [Ljavax.management.openmbean.CompositeData; cannot be cast to [Lorg.neo4j.management.ClusterMemberInfo;
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    FULL PRODUCT VERSION : java version "1.6.0_25" Java(TM) SE Runtime Environment (build 1.6.0_25-b06) Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode, sharing) ADDITIONAL OS VERSION INFORMATION : Microsoft Windows XP [Version 5.1.2600] A DESCRIPTION OF THE PROBLEM : If i use getDiagnoseOptions() of a HotSpotDiagnosticMXBean instance, a classcast exception occures. REGRESSION. Last worked in version 6u25 STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : get HotSpotDiagnosticsMXBean instance and try to get diagnostic options EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - any output like 'options: [<vmoptions>]' ACTUAL - Exception in thread "main" java.lang.ClassCastException: [Ljavax.management.openmbean.CompositeData; cannot be cast to java.util.List at $Proxy0.getDiagnosticOptions(Unknown Source) at Dummy.main(Dummy.java:17) ERROR MESSAGES/STACK TRACES THAT OCCUR : Exception in thread "main" java.lang.ClassCastException: [Ljavax.management.openmbean.CompositeData; cannot be cast to java.util.List at $Proxy0.getDiagnosticOptions(Unknown Source) at Dummy.main(Dummy.java:17) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- import java.lang.management.ManagementFactory; import java.util.List; import javax.management.MBeanServerInvocationHandler; import javax.management.ObjectName; import com.sun.management.HotSpotDiagnosticMXBean; import com.sun.management.VMOption; public class Dummy2 { public static void main(String[] args) throws Exception { ObjectName hsdObjectName = new ObjectName( "com.sun.management:type=HotSpotDiagnostic"); HotSpotDiagnosticMXBean hsdMXBean = MBeanServerInvocationHandler .newProxyInstance(ManagementFactory.getPlatformMBeanServer(), hsdObjectName, HotSpotDiagnosticMXBean.class, false); List<VMOption> options = hsdMXBean.getDiagnosticOptions(); System.out.printf("options: %1$s\n", options); } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Get attribute directly from MBeanServer: import java.lang.management.ManagementFactory; import java.util.Arrays; import javax.management.MBeanServer; import javax.management.ObjectName; import javax.management.openmbean.CompositeData; public class Dummy { public static void main(String[] args) throws Exception { ObjectName hsdObjectName = new ObjectName( "com.sun.management:type=HotSpotDiagnostic"); MBeanServer F_server = ManagementFactory.getPlatformMBeanServer(); CompositeData[] attribute = (CompositeData[]) F_server.getAttribute( hsdObjectName, "DiagnosticOptions"); System.out.printf("Options: %1$s\n", Arrays.toString(attribute)); } }

    JDK Bug System | 6 years ago | J. Duke
    java.lang.ClassCastException: [Ljavax.management.openmbean.CompositeData; cannot be cast to java.util.List
  6. 0

    Memcached Java客户端2.6.1发布 - 编程语言 - ITeye资讯

    iteye.com | 1 year ago
    java.lang.ClassCastException: cannot be cast to

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      [Ljavax.management.openmbean.CompositeData; cannot be cast to javax.management.openmbean.CompositeData

      at com.reddipped.sysstats.model.SystemInfoCollector.run()
    2. com.reddipped.sysstats
      SystemInfoCollector.run
      1. com.reddipped.sysstats.model.SystemInfoCollector.run(SystemInfoCollector.java:81)
      1 frame
    3. Java RT
      ScheduledThreadPoolExecutor$ScheduledFutureTask.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      2. java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
      3. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
      4. java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      4 frames