Have you compared your MBean and ant project with
the jboss build?
It worked for me, that's why it's in xdoclet. The service template works off @jmx:managed-attribute tags. However, it doesn't currently use the default object name that is put into OBJECT_NAME in the generated interface, so the name="" is expected.
Check the template at http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/xdoclet/xdoclet/core/resources/xdoclet/jmx/vendor/jboss-service-template.j
to see what to expect. Suggestions on how to make this more useful are definitely appreciated;-)
Thanks for your replys. I have worked out how to use xdoclet to generate MBean interface and xxxxx-service.xml descriptor. The problem that I had was that the template file, jboss-service-template.j, coming with xdoclet is not completed and needs to be customised. I have modified the file and rebuild the JAR fiel and it works.
However, I have come across with some problems in JBoss3.0:
1. If an attibute is type of java.lang.Integer, JBoss will throw an exception say "no editor found for java.lang.Integer ......". It is ok after I changed the attribute to the type of String.
2. When using Ant to hot deploy the bean to JBoss, although there is a default constructor implemented in my MBean, the JBoss server throws an exception as follows:
org.jboss.deployment.DeploymentException: could not create mbean; - nested throw
able is: ReflectionException: deploy.TestDeploy does not have a public no args constructor.
I haven't been able to solve the problem yet. Any idea?