You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Frederic Brunel <fr...@in-fusio.com> on 2003/05/20 11:29:12 UTC

Deploying an MBean from a Servlet code

Hi all,

I've some problems deploying a MBean from inside a Servlet. I would like
to monitor one of my Servlet's component using JMX and I would like the
MBean to appear in the Tomcat's Administration console under the context
of my application (if it's possible).

To register my MBean, I've first retrieved the running MBean server
instance inside Tomcat using "MBeanServerFactory.findMBeanServer(null)".
I know that my MBean is successfully registered because I've also
started an mx4j Http server just to see all Tomcat MBeans but my MBean
doesn't appear anywhere in the Tomcat's Administration console. 

I'm quite sure it's because of the naming scheme. The Tomcat
documentation is not clear about that and they only talk about deploying
MBeans using the "mbeans-descriptor.xml" but it seems to apply only to
Reams and Valves.

Thanx for you help.

-- 
Frederic Brunel
Senior Software Engineer
In-Fusio - Mobile Game Connections


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


Re: Deploying an MBean from a Servlet code

Posted by Frederic Brunel <fr...@in-fusio.com>.
> If you have the Jk-Coyote Connector enabled, then setting
>   mx.port=<portnum>
> in your jk2.properties file will do it.  Of course, specify a real numeric
> value (of the port you want the concol to listen on) in place of <portnum>
> above.

Ok, thanx for your answer. I'll try this!

-- 
Frederic Brunel
Senior Software Engineer
In-Fusio - Mobile Game Connections


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


Re: Deploying an MBean from a Servlet code

Posted by Bill Barker <wb...@wilshire.com>.
If you have the Jk-Coyote Connector enabled, then setting
  mx.port=<portnum>
in your jk2.properties file will do it.  Of course, specify a real numeric
value (of the port you want the concol to listen on) in place of <portnum>
above.

"Frederic Brunel" <fr...@in-fusio.com> wrote in message
news:1053510463.18707.189.camel@buzz.in-fusio.com...
> > The current 4.1.x admin webapp doesn't handle foreign (i.e. non-Tomcat)
> > components well.  TC 5.0 may work better, but for now I'd suggest
enabling
> > the JMX consol to do this.
>
> Thanx for the information. How do I enable this console? I've not find
> the way to configure it within Tomcat. It is included with it or it is
> an external application (or some kind of Web application)?
>
> --
> Frederic Brunel
> Senior Software Engineer
> In-Fusio - Mobile Game Connections




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


Re: Deploying an MBean from a Servlet code

Posted by Frederic Brunel <fr...@in-fusio.com>.
> The current 4.1.x admin webapp doesn't handle foreign (i.e. non-Tomcat)
> components well.  TC 5.0 may work better, but for now I'd suggest enabling
> the JMX consol to do this.

Thanx for the information. How do I enable this console? I've not find
the way to configure it within Tomcat. It is included with it or it is
an external application (or some kind of Web application)?

-- 
Frederic Brunel
Senior Software Engineer
In-Fusio - Mobile Game Connections


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


Re: Deploying an MBean from a Servlet code

Posted by Johannes Fiala <to...@fwd.at>.
Hi there,

I've got two related questions:

1.) Context startup order problem due to JMX MBeanServer:
I've written a servlet residing in a separate Context "mbeanserver" which 
starts the MBeanServer and stores it into the ServletContext.
In all other Contexts I refer to 
context.getContext("mbeanserver").getAttribute("mbeanserver") to retrieve 
the running MBeanServer. However, if I want to use the load-on-startup 
setting in one of the Servlets using the MBeanServer I have troubles 
because the MBeanServer is not guaranteed to have been started BEFORE the 
servlet using it does initialize. 

Does anybody have a suggestion how to solve this? Should a servlet 
referring to the mbeanserver "pause" the init() routine until it finds the 
mbeanserver?

2.) Making MBeans persistent - standards?
Did you have the problem so far to make MBeans persistent? Is there a 
standard way of making them persistent or does everybody write his own 
serializiation routines (XML file or DB)?

thx alot
Johannes




"Bill Barker" <wb...@wilshire.com> 
Sent by: news <ne...@main.gmane.org>
21.05.2003 08:14
Please respond to
"Tomcat Users List" <to...@jakarta.apache.org>


To
tomcat-user@jakarta.apache.org
cc

Subject
Re: Deploying an MBean from a Servlet code






The current 4.1.x admin webapp doesn't handle foreign (i.e. non-Tomcat)
components well.  TC 5.0 may work better, but for now I'd suggest enabling
the JMX consol to do this.

"Frederic Brunel" <fr...@in-fusio.com> wrote in message
news:1053422951.18707.30.camel@buzz.in-fusio.com...
> Hi all,
>
> I've some problems deploying a MBean from inside a Servlet. I would like
> to monitor one of my Servlet's component using JMX and I would like the
> MBean to appear in the Tomcat's Administration console under the context
> of my application (if it's possible).
>
> To register my MBean, I've first retrieved the running MBean server
> instance inside Tomcat using "MBeanServerFactory.findMBeanServer(null)".
> I know that my MBean is successfully registered because I've also
> started an mx4j Http server just to see all Tomcat MBeans but my MBean
> doesn't appear anywhere in the Tomcat's Administration console.
>
> I'm quite sure it's because of the naming scheme. The Tomcat
> documentation is not clear about that and they only talk about deploying
> MBeans using the "mbeans-descriptor.xml" but it seems to apply only to
> Reams and Valves.
>
> Thanx for you help.
>
> --
> Frederic Brunel
> Senior Software Engineer
> In-Fusio - Mobile Game Connections




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



Re: Deploying an MBean from a Servlet code

Posted by Bill Barker <wb...@wilshire.com>.
The current 4.1.x admin webapp doesn't handle foreign (i.e. non-Tomcat)
components well.  TC 5.0 may work better, but for now I'd suggest enabling
the JMX consol to do this.

"Frederic Brunel" <fr...@in-fusio.com> wrote in message
news:1053422951.18707.30.camel@buzz.in-fusio.com...
> Hi all,
>
> I've some problems deploying a MBean from inside a Servlet. I would like
> to monitor one of my Servlet's component using JMX and I would like the
> MBean to appear in the Tomcat's Administration console under the context
> of my application (if it's possible).
>
> To register my MBean, I've first retrieved the running MBean server
> instance inside Tomcat using "MBeanServerFactory.findMBeanServer(null)".
> I know that my MBean is successfully registered because I've also
> started an mx4j Http server just to see all Tomcat MBeans but my MBean
> doesn't appear anywhere in the Tomcat's Administration console.
>
> I'm quite sure it's because of the naming scheme. The Tomcat
> documentation is not clear about that and they only talk about deploying
> MBeans using the "mbeans-descriptor.xml" but it seems to apply only to
> Reams and Valves.
>
> Thanx for you help.
>
> --
> Frederic Brunel
> Senior Software Engineer
> In-Fusio - Mobile Game Connections




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