You need to have the JkCoyote connector running (even if you are using
Tomcat stand-alone), and in your $CATALINA_HOME/conf/jk2.properties file
add:
  mx.port=9000
Of course, change '9000' to whatever port you want the JMX consol to listen
to.

Note:  There is a bug in Tomcat that is doesn't shutdown the consol properly
if you use this option.  As a result, you will lose the ability to do a
clean shutdown.

"s p" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi Purvis,
>
> Thanks for the reply.
> This code will give me the MBeanServers on the same
> JVM
> But in our case we want to get the MBeanServer of a
> remote Tomcat. The Tomat server may be running on any
> other machine. I would have the port number and the
> address of the machine where the Tomcat is running. So
> the problem is to get MBeanServer of this Tomcat.
> Do we have any APIs for doing this?
>
> Santosh
>
> --- Purvis Robert <[EMAIL PROTECTED]> wrote:
> > I've done this just recently in fact! I was looking
> > for a means of
> > monitoring objects within our Tomcat and dicovered
> > JMX. To get to Tomcats
> > Mbean Server you use the following (I've got it in a
> > GeneralJMX class in a
> > static method for easy of reuse):
> >
> > public class GeneralJMX {
> >
> >    /** Creates a new instance of GeneralJMX */
> >    public GeneralJMX() {
> >    }
> >
> >
> >
>
/***************************************************************************
> > *
> >     * Get the MBean server associated with Tomcat.
> >     *
> >     * @return the MBean server, or null if one canot
> > be found.
> >     */
> >
> >    public static MBeanServer getTomcatMBeanServer()
> > {
> >       MBeanServer server = null;
> >       List myList =
> > MBeanServerFactory.findMBeanServer(null);
> >       if (myList.toArray().length > 0)
> >          server = (MBeanServer)myList.toArray()[0];
> >
> >       return server;
> >    }
> >
> > }
> >
> > -----Original Message-----
> > From: s p [mailto:[EMAIL PROTECTED]
> > Sent: 27 August 2003 03:59
> > To: [EMAIL PROTECTED]
> > Subject: How to get reference of MBeanServer in
> > Tomcat
> >
> >
> > I am using JMX technology to get information of
> > Tomcat
> > server. I am unable to get the reference of the
> > MBeanServer in Tomcat. Has any one worked on this
> > before. I am able get the information for other
> > application servers like weblogic and webshere. But
> > I
> > did not find suitable APIs for Tomcat. Any help in
> > this direction will be appreciated.
> >
> > Regards,
> > Santosh
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site
> > design software
> > http://sitebuilder.yahoo.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > This e-mail is confidential and privileged.  If you
> > are not the intended
> > recipient please accept our apologies;  please do
> > not disclose, copy or
> > distribute information in this e-mail or take any
> > action in reliance on its
> > contents:  to do so is strictly prohibited and may
> > be unlawful.  Please
> > inform us that this message has gone astray before
> > deleting it.  Thank you
> > for your co-operation.
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to