简体   繁体   中英

JMX MXBean proxy InvalidObjectException

Can anyone help me to figure out the problem?

my com.intel.esg.ecp.cli.Command connected to JMX, and find the MXBean com.acme.AcmeManager, it supposes to call createObject to create AcmeObject.

Both AcmeManager and AcmeObject are designed to be MXBean, and I published the without issue.

Does the stack mean the AcmeObject doesn't confirm the MXBean standard or AcmeManager doesn't confirm the MXBean standard? I am new to JMX MXBean, and can someone points me some useful materials?

Thanks

Executing 'createObject' ...
ERROR: Cannot make MXBean proxy for com.acme.AcmeManager: java.io.InvalidObjectException: Do not know how to make a com.acme.Acme from a CompositeData: no method from(CompositeData); no constructor has @ConstructorProperties  
annotation; does not have a public no-arg constructor; contains methods other than getters (getStatus)

java.lang.IllegalArgumentException: Cannot make MXBean proxy for com.acme.AcmeManager: java.io.InvalidObjectException: Do not know how to make a com.acme.AcmeObject from a CompositeData: no method from(CompositeData); no 
constructor has @ConstructorProperties annotation; does not have a public no-arg constructor; contains methods other than getters (getStatus)
        at javax.management.MBeanServerInvocationHandler.findMXBeanProxy(MBeanServerInvocationHandler.java:323)
        at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:247)
        at $Proxy18.createObject(Unknown Source)
        at com.acme.cli.commands.tenant.CreateTenantCommand.implExecute(CreateTenantCommand.java:71)
        at com.intel.esg.ecp.cli.Command.execute(Command.java:64)
        at com.intel.esg.ecp.cli.CLI.execute(CLI.java:332)
        at com.acme.cli.commands.Main.main(Main.java:174)

Caused by: java.io.InvalidObjectException: Do not know how to make a com.acme.AcmeObject from a CompositeData: no method from(CompositeData); no constructor has @ConstructorProperties annotation; does not have a public no-arg   
constructor; contains methods other than getters (getStatus)
        at com.sun.jmx.mbeanserver.OpenConverter.invalidObjectException(OpenConverter.java:1403)
        at com.sun.jmx.mbeanserver.OpenConverter$CompositeConverter.makeCompositeBuilder(OpenConverter.java:891)
        at com.sun.jmx.mbeanserver.OpenConverter$CompositeConverter.checkReconstructible(OpenConverter.java:897)
        at com.sun.jmx.mbeanserver.OpenConverter$CollectionConverter.checkReconstructible(OpenConverter.java:663)
        at com.sun.jmx.mbeanserver.ConvertingMethod.checkCallToOpen(ConvertingMethod.java:94)
        at com.sun.jmx.mbeanserver.MXBeanProxy$Visitor.visitAttribute(MXBeanProxy.java:53)
        at com.sun.jmx.mbeanserver.MXBeanProxy$Visitor.visitAttribute(MXBeanProxy.java:48)
        at com.sun.jmx.mbeanserver.MBeanAnalyzer.visit(MBeanAnalyzer.java:53)
        at com.sun.jmx.mbeanserver.MXBeanProxy.<init>(MXBeanProxy.java:45)
        at javax.management.MBeanServerInvocationHandler.findMXBeanProxy(MBeanServerInvocationHandler.java:319)
        ... 6 more
~>

From the documentation

The MXBean concept provides a simple way to code an MBean that only references a predefined set of types, the ones defined by javax.management.openmbean. In this way, you can be sure that your MBean will be usable by any client, including remote clients, without any requirement that the client have access to model-specific classes representing the types of your MBeans.

Clearly, com.acme.Acme and com.acme.AcmeObject are custom types and they don't define the conversion to/from opendata types. See the OpenData type mapping rules for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM