ConversionNotSupportedException encountered when deploying a Spring MBeanExporter in JBoss
Issue
-
I have a JMX-enabled bean which fails to initialize on JBoss. The bean is configured using the Spring Framework
MBeanExporterwhich uses the JBoss classMBeanServerLocator, methodlocateJBossto find the JMX server,<bean id="mbeanServer" class="org.jboss.mx.util.MBeanServerLocator" factory-method="locateJBoss"/> <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false"> <property name="beans"> <map> <entry key="bean:name=SomeService" value-ref="waitTimesService"/> </map> </property> -
During deployment the following error is encountered:
ERROR [ContextLoader] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'exporter' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.jboss.mx.server.MBeanServerImpl' to required type 'javax.management.MBeanServer' for property 'server'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.jboss.mx.server.MBeanServerImpl] to required type [javax.management.MBeanServer] for property 'server': no matching editors or conversion strategy found -
It would seem the
locateJBossmethod is not returning an instance ofjavax.management.MBeanServer.
Environment
- JBoss Enterprise Application Platform (EAP) 5.0
- Spring 3.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.