2 Replies Latest reply on Nov 6, 2008 5:23 PM by sfisque

    Best Way to Deploy JMX Classes

      Hi - JBOSS/JMX newbie seeking advice..

      We have a largish application.ear that is deployed in server/default/deploy.

      Inside the ear are some classes that implement ServiceMBean to provide some customized JMX monitoring for the app.

      Question is how can I tell JMX to load these classes from the deployed application.ear file? Or must I repackage the required classes into a .jar file and deploy that to /server/default/lib?

      Here is the xml that defines our custom JMX service. Is there any way to tell JOBSS to load this MBEAN from the application.ear?



      Property1
      Property2




      thx
      David

        • 1. Re: Best Way to Deploy JMX Classes

          Sorry - here is the XML

          <server>
           <mbean code="com.xxx.platform.jmx.MonitoringService"
           name="xxx.monitoring:type=xxxMonitoring">
           <attribute name="Property1">Property1</attribute>
           <attribute name="Property2">Property2</attribute>
           </mbean>
          </server>
          


          • 2. Re: Best Way to Deploy JMX Classes
            sfisque

            you can package the mbean/impl classes in a ..SAR (its similar to an .EAR, check the docs) and either configure it internally with a jboss-service.xml or externally with a "-service.xml" file in the deploy directory. each way has its advantages.

            i did something similar to this, where the .SAR was deployed with a jboss-service.xml internally, and then i wrapped that with an external mbean to schedule it (using the varia scheduler).

            if you deploy your jar file in the [lib] dir, its bootstrapped at runtime and cannot be hot deployed/undeployed. which might be preferable. if its deployed as a .SAR, you can deploy/undeploy to your hearts content as long as your unbind/rebind methods are proper.

            HTH

            == stanton