You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by sr...@srikanth.org on 2003/05/20 14:54:18 UTC
How to use Custom Beans with Tomcat
Hi,
I am using Tomcat 4.1.24
First, I have gone thru the MBean Descriptor HOW-TO in
the documentation. That document basically tells me to
put the MBeans descriptor xml file into server.xml as a
Listener element.
But for this approach to work, the MBean class should
be visible to the Tomcat - which basically means the
MBean class should exist in server/lib (or common/lib)
- since that is the parent class loader - a requirement
that one cannot often meet since the MBean is very
application specific.
Can anyone suggest what is the preferred approach ?
If I were to package my custom MBean in my war, how do
I go about getting it registered with the MBeanServer ?
I also tried another funky approach of moving
mx4j-jmx.jar, commons-modelet.jar and related commons
jar into commons-lib - so that I can access the
Registry class in the commons-modeller from my web
application and add my MBean to it. In this case,
Tomcat just fails to startup, and there is no log at
all.
I appreciate any insights, comments and suggestions
Thanks,
Srikanth
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: How to use Custom Beans with Tomcat
Posted by Bill Barker <wb...@wilshire.com>.
Assuming that your bean isn't a standard Tomcat component (e.g.
Valve/Realm/Authenticator), then the best move is to move the JMX jars to
common/lib (assuming that you trust all of the webapps that you are running
:), and register it in a load-on-startup servlet. See the commons-modeler
docs for more details.
<sr...@srikanth.org> wrote in message
news:20030520055419.16575.h016.c001.wm@mail.srikanth.org.criticalpath.net...
> Hi,
>
> I am using Tomcat 4.1.24
>
> First, I have gone thru the MBean Descriptor HOW-TO in
> the documentation. That document basically tells me to
> put the MBeans descriptor xml file into server.xml as a
> Listener element.
>
> But for this approach to work, the MBean class should
> be visible to the Tomcat - which basically means the
> MBean class should exist in server/lib (or common/lib)
> - since that is the parent class loader - a requirement
> that one cannot often meet since the MBean is very
> application specific.
>
> Can anyone suggest what is the preferred approach ?
>
> If I were to package my custom MBean in my war, how do
> I go about getting it registered with the MBeanServer ?
>
> I also tried another funky approach of moving
> mx4j-jmx.jar, commons-modelet.jar and related commons
> jar into commons-lib - so that I can access the
> Registry class in the commons-modeller from my web
> application and add my MBean to it. In this case,
> Tomcat just fails to startup, and there is no log at
> all.
>
> I appreciate any insights, comments and suggestions
>
> Thanks,
> Srikanth
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org