4 Replies Latest reply on Feb 9, 2005 1:49 PM by A Narang

    Standalone application JMX example

    A Narang Newbie

      I have a standalone application (does not run in JBOSS). I've exposed an MBean in it for remote management purpose.
      Now how do I use JBOSS to display the management console. The examples I've seen, display how to manage applications running in JBOSS.
      Would be great if someone can point me to an appropriate example or litrature.
      Thanks.

        • 1. Re: Standalone application JMX example
          Dimitris Andreadis Master

          AFAIK, the jboss management console needs to run in the same JVM with the MBeanServer that hosts the mbeans.

          Otherwise it would have to be modified to use a remove JMX connector, but this would require some changes to the code.

          One solution is to try and use the old "http adapter" that comes with Sun jmx1.0 tools library (if I remember correctly). This was a essentially a very primitive web server->JMX that can be started inside your application.

          However, the preferred solution would be to start from the minimal jboss configuration and load your MBean inside jboss (since this is an MBean already, it's a piece of cake). Except for the console you'll get lots of freebies, like advanced classloading, hot-deployment, xml descriptors for loading your stuff, etc. etc. etc.

          • 2. Re: Standalone application JMX example
            A Narang Newbie

            Thanks for replying Dimitris.
            I'd want to keep the application and management seperate.

            Lets say I want to develop a custom management console (JSP) for the application. The JSP will bind to MBean instance and expose functionality to a web interface.
            Is there anybody who has done it, or point me to an example.
            Thanks

            • 3. Re: Standalone application JMX example
              Dimitris Andreadis Master

              Independent of what you'll do with the MBeans remotely (display, get/set attrs, whatever), you'll need a connector to access them. A connector implementation usually differs from JMX implementation to another, unless the JSR160 spec is fully supported (it's only partially supported by jboss).

              So it depends on the JMX implementation you'll be using in your server appllication.

              I presume if you take the existing jmx-console as a starting point you may be able to change it to point to remote instances, over non-jboss connectors.

              If you are not in a big hurry, a new JBossAdminConsole is in the works, and I believe most of what is discussed here will be standard functionality.

              • 4. Re: Standalone application JMX example
                A Narang Newbie

                Well I can use the JBoss JMX implementation on both ends, so there won't be any issue with the non-jsr-compliant implementation.