You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tom Beginner <to...@hotmail.com> on 2004/03/16 09:49:44 UTC

How to register the mbean on server?

Hi. I had been dealing with registering my own mbean on Tomcat 5.0.19.

At Jakarta's site, I found this page.
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/mbeans-descriptor-howto.html

I found org.apache.catalina.mbeans.mbeans-descriptor.xml but it was the
source directory. I wonder if I have to fix this xml and recompile Tomcat.
and I have no confidence with doing that, so I skipped this part.

Then, I tried next step. It said
> You may configure custom components (e.g. Valves/Realms) by
> including your own mbean-descriptor file(s), and setting the "descriptors"
> attribute to point to a ';' separated list of paths (in the ClassLoader
sense)
> of files to add to the default list under ServerLifecycleListener
definition
> in server.xml
>
so, I fixed server.xml like this
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
          debug="0"
          descriptors="mbean-descriptor.xml"/>
and put mbean-descripter.xml in %CATLINA_HOME%/conf/

mbean-descripter.xml is
<?xml version="1.0"?>
<mbeans-descriptors>
<mbean name="Hello"
         domain="DefaultAgent" <-- MBeanServer
         group="Wrapper"
         type="test.Hello"> <--class name
  <attribut name="Message"
            type="java.lang.String"/>
</mbean>
</mbeans-descriptors>

then I restarted Tomcat... but nothing happened.
My goal is that the servlet can call mbean and execute that mbean.
If you know how to register mbean or find samples,
please tell me.

Thank you

Tom

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