views:

627

answers:

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.

+4  A: 

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
+1  A: 

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
A: 

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

Dan Dan
A: 

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();
    }
Joe Armstrong