3 Replies Latest reply on Apr 22, 2002 4:51 AM by qwang

    How to use xdoclet to create MBean interface and to deploy M

    qwang

      I am currently trying to use Ant1.4 and xdoclet1.1.2 to generate interface and xxxxx-service.xml for MBeans to be deployed to JBoss3.0.0RC1. By following the sample of xdoclet1.1.2, I can generate the interface xxxxxMBean, xxxxx-service.xml and xxxxx.xml. However, in the xxxxx-service.xml file, "name" attribute of tag is always empty and there is no tag generated for writable attributes. It seems to me that the xxxxx-service.xml is generated by introspection and the class and name attributes for @jmx:mbean tag always ignored.

      Any help?

      qwang

        • 1. Re: How to use xdoclet to create MBean interface and to depl

          Have you compared your MBean and ant project with
          the jboss build?

          Regards,
          Adrian

          • 2. Re: How to use xdoclet to create MBean interface and to depl
            davidjencks

            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;-)

            david jencks

            • 3. Re: How to use xdoclet to create MBean interface and to depl
              qwang

              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?

              Regards

              qwang