4

We have 2 applications that run under JBoss. I am looking for a way to reduce the overhead of the server. The main app runs under Tomcat. The other app is made up of MBeans. Is there a way to run MBeans under Tomcat?

Alternative suggestions are appreciated.

Quinn Taylor
  • 44,553
  • 16
  • 113
  • 131
Joshua
  • 26,234
  • 22
  • 77
  • 106

4 Answers4

6

MBeans are a part of the JMX specification which is included in the JRE. It should be possible to run MBeans under Tomcat. Tomcat 5 or later provides an MBean server.

Martin OConnor
  • 3,583
  • 4
  • 25
  • 32
2

You can use the following JVM arguments to startup Tomcat with MBean enabled

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=4444 (could be anything)
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
utku.utkan
  • 83
  • 6
2

You also should use the MBean server that is in tomcat - you have to find that one via:

    // find the existing MBean server (tomcat's) in lieu of
    // creating our own
    //
    ArrayList<MBeanServer> mbservers = MBeanServerFactory
            .findMBeanServer(null);

    int nservers = mbservers.size();
    if (nservers > 0) {
        //
        // TODO: A better way to get the currently active server ?
        // For some reason, every time the webapp is reloaded there is one
        // more instance of the MBeanServer
        mbserver = (MBeanServer) mbservers.get(nservers - 1);
    }

    if (mbserver == null) {
        mbserver = MBeanServerFactory.createMBeanServer();
    }
1

Try this http://community.jboss.org/wiki/JBossASTuningSliming. Sure you have many services without usage.

Dan Dan
  • 11
  • 1