You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Costin Manolache <co...@gmail.com> on 2008/05/05 05:31:21 UTC

JConsole and tomcat.

This is a proposal for a very small change in tomcat trunk, to make tomcat
easier to use with JConsole.
Right now if you start tomcat 'out of box' and than try to inspect it with
jconsole, you'll only see the 'platform' mbeans
(memory etc). That's because tomcat doesn't use the platform mbean server.

The fix is simple - in main or anywhere before the first
MBeanServerFactory.findMBeanServer(null) we need
to add a ManagementFactory.getPlatformMBeanServer(). This way modeler and
tomcat will find the platform
mbean server as the first server and use it. A better fix would be to
replace all usages of findMBeanServer with
getPlatformMBeanServer.

The options are:
- add a flag/system property to enable this behavior

- make it default, add a flag to disable and use separate server

- just use getPlatformMBeanServer with no flag.

The javadoc is:

  " It is recommended that this platform MBeanServer also be used
    to register other application managed beans  besides the platform
MXBeans.
   This will allow all MBeans to be published through the same
    MBeanServer and hence allow for easier network publishing
    and discovery."


I can't think of any good reason to use a separate MBean server - and using
jconsole is quite nice, all
other methods of remote JMX documented on our site are more complex ( but
good for specific cases ).
The extra benefit is that we can see both memory/logging/other platform
mbeans in the same place with
tomcat beans.

Options ? Can I just add the one liner before the first invocation of
MBeanServerFactory ?


Costin

Re: JConsole and tomcat.

Posted by Henri Gomez <he...@gmail.com>.
+1 also here, I'm using JConsole extensivly

2008/5/5 Yoav Shapira <yo...@apache.org>:
> On Sun, May 4, 2008 at 11:49 PM, Costin Manolache <co...@gmail.com> wrote:
>  >  If you don't add the option - you'll see that tomcat uses a separate mbean
>  >  server. I want to have it consistent -
>  >  with or without -Dcom.sun... to use the platform mbean server.
>
>  +1 from me.  Maybe add a flag to disable this behavior, to be safe,
>  but I like it as the default.
>
>  Yoav
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>  For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: JConsole and tomcat.

Posted by Yoav Shapira <yo...@apache.org>.
On Sun, May 4, 2008 at 11:49 PM, Costin Manolache <co...@gmail.com> wrote:
>  If you don't add the option - you'll see that tomcat uses a separate mbean
>  server. I want to have it consistent -
>  with or without -Dcom.sun... to use the platform mbean server.

+1 from me.  Maybe add a flag to disable this behavior, to be safe,
but I like it as the default.

Yoav

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: JConsole and tomcat.

Posted by Costin Manolache <co...@gmail.com>.
I think that's doing the same thing - loading the platform mbean server
early on.

If you don't add the option - you'll see that tomcat uses a separate mbean
server. I want to have it consistent -
with or without -Dcom.sun... to use the platform mbean server.


Costin

On Sun, May 4, 2008 at 8:40 PM, Jess Holle <je...@ptc.com> wrote:

> I guess I'm doing something "funny" then because I see a *lot* of Tomcat
> MBeans in jconsole.
>
> I added -Dcom.sun.management.jmxremote, of course -- to cover Java 5 and
> left it in place for Java 6, but otherwise I don't think I did anything
> funny until within my web app.
>
>
> Costin Manolache wrote:
>
> > This is a proposal for a very small change in tomcat trunk, to make
> > tomcat
> > easier to use with JConsole.
> > Right now if you start tomcat 'out of box' and than try to inspect it
> > with
> > jconsole, you'll only see the 'platform' mbeans
> > (memory etc). That's because tomcat doesn't use the platform mbean
> > server.
> >
> > The fix is simple - in main or anywhere before the first
> > MBeanServerFactory.findMBeanServer(null) we need
> > to add a ManagementFactory.getPlatformMBeanServer(). This way modeler
> > and
> > tomcat will find the platform
> > mbean server as the first server and use it. A better fix would be to
> > replace all usages of findMBeanServer with
> > getPlatformMBeanServer.
> >
> > The options are:
> > - add a flag/system property to enable this behavior
> >
> > - make it default, add a flag to disable and use separate server
> >
> > - just use getPlatformMBeanServer with no flag.
> >
> > The javadoc is:
> >
> >  " It is recommended that this platform MBeanServer also be used
> >    to register other application managed beans  besides the platform
> > MXBeans.
> >   This will allow all MBeans to be published through the same
> >    MBeanServer and hence allow for easier network publishing
> >    and discovery."
> >
> >
> > I can't think of any good reason to use a separate MBean server - and
> > using
> > jconsole is quite nice, all
> > other methods of remote JMX documented on our site are more complex (
> > but
> > good for specific cases ).
> > The extra benefit is that we can see both memory/logging/other platform
> > mbeans in the same place with
> > tomcat beans.
> >
> > Options ? Can I just add the one liner before the first invocation of
> > MBeanServerFactory ?
> >
> >
> > Costin
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

Re: JConsole and tomcat.

Posted by Jess Holle <je...@ptc.com>.
I guess I'm doing something "funny" then because I see a *lot* of Tomcat 
MBeans in jconsole.

I added -Dcom.sun.management.jmxremote, of course -- to cover Java 5 and 
left it in place for Java 6, but otherwise I don't think I did anything 
funny until within my web app.

Costin Manolache wrote:
> This is a proposal for a very small change in tomcat trunk, to make tomcat
> easier to use with JConsole.
> Right now if you start tomcat 'out of box' and than try to inspect it with
> jconsole, you'll only see the 'platform' mbeans
> (memory etc). That's because tomcat doesn't use the platform mbean server.
>
> The fix is simple - in main or anywhere before the first
> MBeanServerFactory.findMBeanServer(null) we need
> to add a ManagementFactory.getPlatformMBeanServer(). This way modeler and
> tomcat will find the platform
> mbean server as the first server and use it. A better fix would be to
> replace all usages of findMBeanServer with
> getPlatformMBeanServer.
>
> The options are:
> - add a flag/system property to enable this behavior
>
> - make it default, add a flag to disable and use separate server
>
> - just use getPlatformMBeanServer with no flag.
>
> The javadoc is:
>
>   " It is recommended that this platform MBeanServer also be used
>     to register other application managed beans  besides the platform
> MXBeans.
>    This will allow all MBeans to be published through the same
>     MBeanServer and hence allow for easier network publishing
>     and discovery."
>
>
> I can't think of any good reason to use a separate MBean server - and using
> jconsole is quite nice, all
> other methods of remote JMX documented on our site are more complex ( but
> good for specific cases ).
> The extra benefit is that we can see both memory/logging/other platform
> mbeans in the same place with
> tomcat beans.
>
> Options ? Can I just add the one liner before the first invocation of
> MBeanServerFactory ?
>
>
> Costin
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org