spring-projects/spring-framework — pull request #413 by bwzhang2011 (2013-11-16 05:19:47+00:00)
Title: 3.2.x

spring3.2.5 seems more strict with in createAndConfigMBean during MBeanExporter does(when invoke the registerBeans), here comes my stack trace:

org.springframework.jmx.export.MBeanExportException: Could not create ModelMBean for managed resource [ConsoleMsgMBeanInfo={fssModProductState_MsgMBean}] with key 'bean:name=fssModProductState_MsgMBean'; nested exception is javax.management.IntrospectionException: type mismatch between getter and setter
at org.springframework.jmx.export.MBeanExporter.createAndConfigureMBean(MBeanExporter.java:797)
at org.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter.java:654)
at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:598)
at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:527)
at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:413)
at com.xyt.channel.server.service.listener.AbstractMBeanLoadEventListener.processAppEvent(Unknown Source)
at com.xyt.channel.server.service.listener.AbstractMBeanLoadEventListener.processAppEvent(Unknown Source)
at com.xyt.channel.component.event.AbstractChannelEventObserver.observeChannelEvent(Unknown Source)
at com.xyt.channel.wko.service.main.ChannelEnvConfiguration$1.startChannelService(Unknown Source)
at com.xyt.channel.wko.service.main.ChannelWkoServiceMain.startChannelService(Unknown Source)
at com.xyt.channel.server.service.main.AbstractChannelServiceMain.startChannelService(Unknown Source)
at com.xyt.channel.wko.service.main.ChannelWkoServiceMain.main(Unknown Source)
Caused by: javax.management.IntrospectionException: type mismatch between getter and setter
at javax.management.MBeanAttributeInfo.attributeType(MBeanAttributeInfo.java:340)
at javax.management.MBeanAttributeInfo.(MBeanAttributeInfo.java:183)
at javax.management.modelmbean.ModelMBeanAttributeInfo.(ModelMBeanAttributeInfo.java:202)
at org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler.getAttributeInfo(AbstractReflectiveMBeanInfoAssembler.java:315)
at org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler.getMBeanInfo(AbstractMBeanInfoAssembler.java:64)
at org.springframework.jmx.export.MBeanExporter.getMBeanInfo(MBeanExporter.java:819)
at org.springframework.jmx.export.MBeanExporter.createAndConfigureMBean(MBeanExporter.java:792)

As shown above, when I went back to spring3.2.4 or lower edition, the error stacktrace would not appear. I hope some could point out my mistake whether I had set wrong MBean Name.