Liang, I'm sorry its one area that has never reved my engine...
and also, did you read this article...
http://oss.wxnet.org/mbeans.html
It looks pretty good to me, and the guy actually says, with tomcat you
either have to init the bean in a servlet and load-at-start.
Because if you dont... the servlet will not be running... and the bean wont
have woken up.
AND then he says, a listener is a better bet... which sound good to me.
I would just try get it all going using that guys code, as a test.
And then something that bothers me...
Why are you using Tomcat's "package names" for your software?
Good way to break Tomcat... I think.
Use your own package names....
com.Liangs.software etc...
Its almost like you half kinda sorta thinking you want to override a TC
class, but you not.
Your code I think is even confusing the experts...
And its not a popular topic... so you very much on your own, unless some guy
in the group happens to have done it, and feels like sharing.
Copy what that other guy did... then just modify it... I think
Good luck... some area's get a little lonely ;)
----- Original Message -----
From: "Liang Xiao Zhu" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Tuesday, May 20, 2008 10:59 AM
Subject: Re: JMX MBean
Can anyone help me?
I did what you said and still doesnt work!!! I show my code and how I've
implemented the whole things.
I added in the java/org/apache/catalina/deploy/mbeans-descriptors.xml the
follow code:
...
<mbean name="Kaugures"
className="org.apache.catalina.mbeans.AuguresMBean"
description="Augures environment"
domain="Catalina"
group="Resources"
type="org.apache.catalina.deploy.Augures">
<attribute name="className"
description="Fully qualified class name of the managed
object"
type="java.lang.String"
writeable="false"/>
<operation name="HelloWorld"
description="Prueba de AUGURUS"
impact="ACTION"
returnType="java.lang.String">
</operation>
...
And the file (java/org/apache/catalina/deploy/Augurus.java) to implement
the bean is here:
package org.apache.catalina.deploy;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import javax.management.ObjectName;
import org.apache.tomcat.util.modeler.Registry;
import org.apache.catalina.mbeans.MBeanUtils;
import org.apache.catalina.mbeans.AugurusMBean;
public class Augurus implements AugurusMBean {
...... etc
---------------------------------------------------------------------------
HARBOR: http://coolharbor.100free.com/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
---------------------------------------------------------------------------
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]