Quick Hint: short hand XMBeans "does not expose management interface"
Posted by acoliver Apr 28, 2005For people who use the "shorthand" form of xmbean descriptors and embed it directly in their -service.xml descriptor here is a quick hint. This is something that regularly trips me up at least.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server
PUBLIC "-//JBoss//DTD MBean Service 3.2//EN"
"http://www.jboss.org/j2ee/dtd/jboss-service_3_2.dtd">
<server>
<mbean code="org.jboss.mail.MailListenerChainService"
name="mail.test:service=mlchain">
<xmbean>
<class>org.jboss.mail.MailListenerChainService</class>
<constructor>
<description>The no-arg constructor</description>
<name>org.jboss.mail.MailListenerChainService</name>
</constructor>
<attribute access="read-write"
setMethod="setListeners"
getMethod="getListeners">
<name>Listeners</name>
<type>org.w3c.dom.Element</type>
</attribute>
<attribute access="read-only" getMethod="getNumberListeners">
<name>NumberListeners</name>
<type>org.w3c.dom.Element</type>
</attribute>
<operation>
<name>processMail</name>
<parameter>
<name>mail</name>
<type>org.jboss.mail.message.Mail</type>
</parameter>
<return-type>org.jboss.mail.message.Mail</return-type>
</operation>
&defaultOperations;
</xmbean>
</mbean>
</server>
The problem is that for the JBoss deployer to detect that "yes, it is an xmbean" and not a "regular mbean" it requires the xmbean-dd attribute on the "mbean" element even though you've embedded the xmbean element. If you forget it (like I did above) you get a very unsatisfying "org.jboss.deployment.DeploymentException: Class does not expose a management interface: java.lang.Object;".
meaning:
...
<server>
<mbean code="org.jboss.mail.MailListenerChainService"
name="mail.test:service=mlchain" xmbean-dd="">
...