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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >